Skip to content

Commit c5003a6

Browse files
committed
resolve review comments
1 parent d6642e2 commit c5003a6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Analysis/InlineCost.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,9 +1738,7 @@ bool CallAnalyzer::simplifyCmpInst(Function *F, CmpInst &Cmp) {
17381738
SQ.DT = &DT;
17391739
Value *SimplifiedInstruction = llvm::simplifyInstructionWithOperands(
17401740
cast<CmpInst>(&Cmp), {CallArg, Cmp.getOperand(1)}, SQ);
1741-
if (!SimplifiedInstruction)
1742-
continue;
1743-
if (auto *ConstVal = dyn_cast<llvm::ConstantInt>(SimplifiedInstruction)) {
1741+
if (auto *ConstVal = dyn_cast_or_null<ConstantInt>(SimplifiedInstruction)) {
17441742
bool IsTrueSuccessor = CallBB == Br->getSuccessor(0);
17451743
SimplifiedValues[&Cmp] = ConstVal;
17461744
if (ConstVal->isOne())

0 commit comments

Comments
 (0)