Skip to content

Commit 5a4935c

Browse files
committed
Address nikic's comment
1 parent c283dab commit 5a4935c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,9 +1869,10 @@ Instruction *InstCombinerImpl::foldCastedBitwiseLogic(BinaryOperator &I) {
18691869

18701870
// Do the logic op in the intermediate width, then widen more.
18711871
Value *NarrowLogic = Builder.CreateBinOp(LogicOpc, X, Y, I.getName());
1872-
if (auto *Disjoint = dyn_cast<PossiblyDisjointInst>(&I);
1873-
Disjoint && Disjoint->isDisjoint())
1874-
cast<PossiblyDisjointInst>(NarrowLogic)->setIsDisjoint(true);
1872+
auto *Disjoint = dyn_cast<PossiblyDisjointInst>(&I);
1873+
auto *NewDisjoint = dyn_cast<PossiblyDisjointInst>(NarrowLogic);
1874+
if (Disjoint && NewDisjoint)
1875+
NewDisjoint->setIsDisjoint(Disjoint->isDisjoint());
18751876
return CastInst::Create(CastOpcode, NarrowLogic, DestTy);
18761877
}
18771878

0 commit comments

Comments
 (0)