mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 18:34:09 +00:00
Use 'getFirstInsertionPt' when trying to insert new instructions during LICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138008 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5ac8547a41
commit
26665de4f7
@ -466,7 +466,7 @@ void LICM::sink(Instruction &I) {
|
|||||||
} else {
|
} else {
|
||||||
// Move the instruction to the start of the exit block, after any PHI
|
// Move the instruction to the start of the exit block, after any PHI
|
||||||
// nodes in it.
|
// nodes in it.
|
||||||
I.moveBefore(ExitBlocks[0]->getFirstNonPHI());
|
I.moveBefore(ExitBlocks[0]->getFirstInsertionPt());
|
||||||
|
|
||||||
// This instruction is no longer in the AST for the current loop, because
|
// This instruction is no longer in the AST for the current loop, because
|
||||||
// we just sunk it out of the loop. If we just sunk it into an outer
|
// we just sunk it out of the loop. If we just sunk it into an outer
|
||||||
@ -509,7 +509,7 @@ void LICM::sink(Instruction &I) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Insert the code after the last PHI node.
|
// Insert the code after the last PHI node.
|
||||||
BasicBlock::iterator InsertPt = ExitBlock->getFirstNonPHI();
|
BasicBlock::iterator InsertPt = ExitBlock->getFirstInsertionPt();
|
||||||
|
|
||||||
// If this is the first exit block processed, just move the original
|
// If this is the first exit block processed, just move the original
|
||||||
// instruction, otherwise clone the original instruction and insert
|
// instruction, otherwise clone the original instruction and insert
|
||||||
@ -644,7 +644,7 @@ namespace {
|
|||||||
for (unsigned i = 0, e = LoopExitBlocks.size(); i != e; ++i) {
|
for (unsigned i = 0, e = LoopExitBlocks.size(); i != e; ++i) {
|
||||||
BasicBlock *ExitBlock = LoopExitBlocks[i];
|
BasicBlock *ExitBlock = LoopExitBlocks[i];
|
||||||
Value *LiveInValue = SSA.GetValueInMiddleOfBlock(ExitBlock);
|
Value *LiveInValue = SSA.GetValueInMiddleOfBlock(ExitBlock);
|
||||||
Instruction *InsertPos = ExitBlock->getFirstNonPHI();
|
Instruction *InsertPos = ExitBlock->getFirstInsertionPt();
|
||||||
StoreInst *NewSI = new StoreInst(LiveInValue, SomePtr, InsertPos);
|
StoreInst *NewSI = new StoreInst(LiveInValue, SomePtr, InsertPos);
|
||||||
NewSI->setAlignment(Alignment);
|
NewSI->setAlignment(Alignment);
|
||||||
NewSI->setDebugLoc(DL);
|
NewSI->setDebugLoc(DL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user