summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
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
commit3be81e9bd76dc5852460cfbd1b8adc12f1e8b475 (patch)
tree2fc0be43aebb878cfdd0176028cad61b4da472fb /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parentc0767e029da2ed84c1f76d0be53e2c65695e20d5 (diff)
downloadbcm5719-llvm-3be81e9bd76dc5852460cfbd1b8adc12f1e8b475.tar.gz
bcm5719-llvm-3be81e9bd76dc5852460cfbd1b8adc12f1e8b475.zip
Set the insertion point correctly for instructions generated by load folding:
they should go *before* the new instruction not after it. llvm-svn: 123420
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 4ac3257ecbe..6a999c2dc9f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud