aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-14 01:33:40 +0000
committerChris Lattner <sabre@nondot.org>2011-01-14 01:33:40 +0000
commit67d98916900a68b5902428e39f9c865c8d02c1bf (patch)
tree71f942c5f1d79c1924750ebd83a7c0d28eecb145
parent09befe90360effa077b1934c0e85e5b7abe00a9c (diff)
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
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 4ac3257ecb..6a999c2dc9 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -890,10 +890,10 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
if (Inst != Begin)
BeforeInst = llvm::prior(llvm::prior(BI));
if (BeforeInst && isa<LoadInst>(BeforeInst) &&
- BeforeInst->hasOneUse() && *BeforeInst->use_begin() == Inst &&
- TryToFoldFastISelLoad(cast<LoadInst>(BeforeInst), FastIS)) {
- // If we succeeded, don't re-select the load.
- --BI;
+ BeforeInst->hasOneUse() && *BeforeInst->use_begin() == Inst) {
+ FastIS->recomputeInsertPt();
+ if (TryToFoldFastISelLoad(cast<LoadInst>(BeforeInst), FastIS))
+ --BI; // If we succeeded, don't re-select the load.
}
continue;
}