Set the insertion point correctly for instructions generated by load folding:

they should go *before* the new instruction not after it. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123420 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2011-01-14 01:33:40 +00:00
parent 09befe9036
commit 67d9891690

View File

@ -890,10 +890,10 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
if (Inst != Begin) if (Inst != Begin)
BeforeInst = llvm::prior(llvm::prior(BI)); BeforeInst = llvm::prior(llvm::prior(BI));
if (BeforeInst && isa<LoadInst>(BeforeInst) && if (BeforeInst && isa<LoadInst>(BeforeInst) &&
BeforeInst->hasOneUse() && *BeforeInst->use_begin() == Inst && BeforeInst->hasOneUse() && *BeforeInst->use_begin() == Inst) {
TryToFoldFastISelLoad(cast<LoadInst>(BeforeInst), FastIS)) { FastIS->recomputeInsertPt();
// If we succeeded, don't re-select the load. if (TryToFoldFastISelLoad(cast<LoadInst>(BeforeInst), FastIS))
--BI; --BI; // If we succeeded, don't re-select the load.
} }
continue; continue;
} }