[llvm-commits] [llvm] r123420 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Chris Lattner sabre at nondot.org
Thu Jan 13 17:33:40 PST 2011


Author: lattner
Date: Thu Jan 13 19:33:40 2011
New Revision: 123420

URL: http://llvm.org/viewvc/llvm-project?rev=123420&view=rev
Log:
Set the insertion point correctly for instructions generated by load folding:
they should go *before* the new instruction not after it. 

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=123420&r1=123419&r2=123420&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jan 13 19:33:40 2011
@@ -890,10 +890,10 @@
           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;
         }





More information about the llvm-commits mailing list