[llvm-commits] [llvm] r49053 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Evan Cheng evan.cheng at apple.com
Tue Apr 1 14:37:32 PDT 2008


Author: evancheng
Date: Tue Apr  1 16:37:32 2008
New Revision: 49053

URL: http://llvm.org/viewvc/llvm-project?rev=49053&view=rev
Log:
Re-materialization is for uses only.

Modified:
    llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=49053&r1=49052&r2=49053&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Apr  1 16:37:32 2008
@@ -794,7 +794,7 @@
 /// folding is possible.
 bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
                                          SmallVector<unsigned, 2> &Ops,
-                                         bool ReMatLoad) const {
+                                         bool ReMat) const {
   // Filter the list of operand indexes that are to be folded. Abort if
   // any operand will prevent folding.
   unsigned MRInfo = 0;
@@ -802,8 +802,8 @@
   if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
     return false;
 
-  // Can't fold a remat'ed load into a two address instruction.
-  if (ReMatLoad && (MRInfo & VirtRegMap::isMod))
+  // It's only legal to remat for a use, not a def.
+  if (ReMat && (MRInfo & VirtRegMap::isMod))
     return false;
 
   return tii_->canFoldMemoryOperand(MI, FoldOps);
@@ -947,7 +947,7 @@
           goto RestartInstruction;
         }
       } else {
-        CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat && isLoad);
+        CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat);
       }
     } else
       CanFold = false;





More information about the llvm-commits mailing list