File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
third_party/intel/lib/LLVMIR Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ if.end:
1515 ; CHECK: [[F0:%.*]] = freeze i8 %yy
1616 ; CHECK-NEXT: %z = sdiv i8 %x, [[F0:%.*]]
1717 %z = sdiv i8 %x , %yy
18- br i1 %cmp , label %if2.then , label %if2.end
18+ br i1 %cmp , label %if2.then , label %if2.end
1919
2020if2.then:
2121 store i8 %z , ptr %v , align 8
@@ -46,12 +46,12 @@ if.end:
4646 ; CHECK: [[F1:%.*]] = freeze i8 %bb
4747 ; CHECK-NEXT: %zz = sdiv i8 %x, [[F1:%.*]]
4848 %zz = sdiv i8 %x , %bb
49- br i1 %cmp , label %if2.then , label %if2.end
49+ br i1 %cmp , label %if2.then , label %if2.end
5050
5151if2.then:
5252 store i8 %z , ptr %v , align 8
5353 br label %if2.end
5454
5555if2.end:
5656 ret void
57- }
57+ }
Original file line number Diff line number Diff line change 66
77using namespace llvm ;
88
9- static bool processBasicBlock (BasicBlock &BB, PHINode *PhiNode) {
9+ static bool processPhiNode (BasicBlock &BB, PHINode *PhiNode) {
1010 if (!any_of (PhiNode->incoming_values (), [](Use &U) {
1111 Constant *C = dyn_cast<Constant>(&U);
12- return C && C->isNullValue ();
12+ return isa<UndefValue>(U) || C && C->isNullValue ();
1313 })) {
1414 return false ;
1515 }
@@ -34,12 +34,8 @@ static bool runOnFunction(Function &F) {
3434 bool Changed = false ;
3535
3636 for (BasicBlock &BB : F) {
37- for (Instruction &I : BB) {
38- if (PHINode *PhiNode = dyn_cast<PHINode>(&I)) {
39- Changed |= processBasicBlock (BB, PhiNode);
40- continue ;
41- }
42- break ;
37+ for (PHINode &PhiNode : BB.phis ()) {
38+ Changed |= processPhiNode (BB, &PhiNode);
4339 }
4440 }
4541
You can’t perform that action at this time.
0 commit comments