File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
third_party/intel/lib/LLVMIR Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 66
77using namespace llvm ;
88
9- static bool processPhiNode (BasicBlock &BB, PHINode *PhiNode) {
10- if (! any_of (PhiNode->incoming_values (), [](Use &U) {
9+ static bool processPhiNode (PHINode *PhiNode) {
10+ if (none_of (PhiNode->incoming_values (), [](Use &U) {
1111 Constant *C = dyn_cast<Constant>(&U);
1212 return isa<UndefValue>(U) || C && C->isNullValue ();
1313 })) {
1414 return false ;
1515 }
1616
1717 bool Changed = false ;
18- for (Instruction &I : BB) {
18+ BasicBlock *BB = const_cast <BasicBlock *>(PhiNode->getParent ());
19+ for (Instruction &I : *BB) {
1920 if (I.getOpcode () == Instruction::SDiv ||
2021 I.getOpcode () == Instruction::SRem) {
2122 const size_t OpIdx = 1 ;
@@ -35,7 +36,7 @@ static bool runOnFunction(Function &F) {
3536
3637 for (BasicBlock &BB : F) {
3738 for (PHINode &PhiNode : BB.phis ()) {
38- Changed |= processPhiNode (BB, &PhiNode);
39+ Changed |= processPhiNode (&PhiNode);
3940 }
4041 }
4142
You can’t perform that action at this time.
0 commit comments