llvm.org GIT mirror llvm / af6721b
When we sink an instruction, this can open up opportunity for the operands to be sunk - add them to the worklist git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212847 91177308-0d34-0410-b5e6-96231b3b80d8 Aditya Nandakumar 5 years ago
2 changed file(s) with 12 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
27292729 // If the user is one of our immediate successors, and if that successor
27302730 // only has us as a predecessors (we'd have to split the critical edge
27312731 // otherwise), we can keep going.
2732 if (UserIsSuccessor && UserParent->getSinglePredecessor())
2732 if (UserIsSuccessor && UserParent->getSinglePredecessor()) {
27332733 // Okay, the CFG is simple enough, try to sink this instruction.
2734 MadeIRChange |= TryToSinkInstruction(I, UserParent);
2734 if (TryToSinkInstruction(I, UserParent)) {
2735 MadeIRChange = true;
2736 // We'll add uses of the sunk instruction below, but since sinking
2737 // can expose opportunities for it's *operands* add them to the
2738 // worklist
2739 for (Use &U : I->operands())
2740 if (Instruction *OpI = dyn_cast(U.get()))
2741 Worklist.Add(OpI);
2742 }
2743 }
27352744 }
27362745 }
27372746
66 ;CHECK: br
77 ;CHECK: br
88 ;CHECK: getelementptr
9 ;CHECK-NEXT: getelementptr
9 ;CHECK-DAG: getelementptr
1010 ;CHECK-DAG: icmp uge
1111 ;CHECK-DAG: icmp uge
1212 ;CHECK-DAG: icmp uge