Skip to content

Commit 6c08d52

Browse files
committed
[InstCombine] Handle non-icmp
1 parent c9dc295 commit 6c08d52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,10 @@ static Value *foldLogOpOfMaskedICmps(Value *LHS, Value *RHS, bool IsAnd,
611611
if (NewMask == *ConstB)
612612
return LHS;
613613
if (NewMask == *ConstD) {
614-
if (IsLogical)
615-
cast<ICmpInst>(RHS)->setSameSign(false);
614+
if (IsLogical) {
615+
if (auto *ICmp = dyn_cast<ICmpInst>(RHS))
616+
ICmp->setSameSign(false);
617+
}
616618
return RHS;
617619
}
618620
}

0 commit comments

Comments
 (0)