Skip to content

Commit 74c8e78

Browse files
committed
simplify phi node incoming values constant check expression
1 parent a91cf86 commit 74c8e78

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

third_party/intel/lib/LLVMIR/LLVMIRFreezeMaskedDivRem.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ using namespace llvm;
88

99
static bool processBasicBlock(BasicBlock &BB, PHINode *PhiNode) {
1010
if (!any_of(PhiNode->incoming_values(), [](Use &U) {
11-
if (Constant *C = dyn_cast<Constant>(&U)) {
12-
return C->isNullValue();
13-
}
14-
return false;
11+
Constant *C = dyn_cast<Constant>(&U);
12+
return C && C->isNullValue();
1513
})) {
1614
return false;
1715
}

0 commit comments

Comments
 (0)