mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-23 12:40:17 +00:00
Use getFirstInsertionPt instead of getFirstNonPHI so that it skips to the proper
insertion place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c264b2f693
commit
b05fdd6bab
@ -456,7 +456,7 @@ void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PN) {
|
||||
// platforms.
|
||||
if (WeakPH) {
|
||||
Value *Conv = new SIToFPInst(NewPHI, PN->getType(), "indvar.conv",
|
||||
PN->getParent()->getFirstNonPHI());
|
||||
PN->getParent()->getFirstInsertionPt());
|
||||
PN->replaceAllUsesWith(Conv);
|
||||
RecursivelyDeleteTriviallyDeadInstructions(PN);
|
||||
}
|
||||
@ -1703,7 +1703,7 @@ void IndVarSimplify::SinkUnusedInvariants(Loop *L) {
|
||||
BasicBlock *Preheader = L->getLoopPreheader();
|
||||
if (!Preheader) return;
|
||||
|
||||
Instruction *InsertPt = ExitBlock->getFirstNonPHI();
|
||||
Instruction *InsertPt = ExitBlock->getFirstInsertionPt();
|
||||
BasicBlock::iterator I = Preheader->getTerminator();
|
||||
while (I != Preheader->begin()) {
|
||||
--I;
|
||||
@ -1903,7 +1903,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
||||
// the end of the pass.
|
||||
while (!OldCannIVs.empty()) {
|
||||
PHINode *OldCannIV = OldCannIVs.pop_back_val();
|
||||
OldCannIV->insertBefore(L->getHeader()->getFirstNonPHI());
|
||||
OldCannIV->insertBefore(L->getHeader()->getFirstInsertionPt());
|
||||
}
|
||||
}
|
||||
else if (ExpandBECount && ReuseIVForExit && needsLFTR(L, DT)) {
|
||||
|
Loading…
Reference in New Issue
Block a user