Fix for PR1831: if all defs of an interval are re-materializable, then it's a preferr...
[oota-llvm.git] / include / llvm / CodeGen / LiveIntervalAnalysis.h
index 19865e59c1ee20f816e32d9b6ecc263810ca6e68..83d8d1dd4b15e44e091d4b84e615a313ac56352a 100644 (file)
@@ -233,6 +233,11 @@ namespace llvm {
     addIntervalsForSpills(const LiveInterval& i,
                           const LoopInfo *loopInfo, VirtRegMap& vrm);
 
+    /// isReMaterializable - Returns true if every definition of MI of every
+    /// val# of the specified interval is re-materializable. Also returns true
+    /// by reference if all of the defs are load instructions.
+    bool isReMaterializable(const LiveInterval &li, bool &isLoad);
+
   private:      
     /// computeIntervals - Compute live intervals.
     void computeIntervals();
@@ -265,9 +270,10 @@ namespace llvm {
                               LiveInterval &interval, bool isAlias = false);
 
     /// isReMaterializable - Returns true if the definition MI of the specified
-    /// val# of the specified interval is re-materializable.
+    /// val# of the specified interval is re-materializable. Also returns true
+    /// by reference if the def is a load.
     bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo,
-                            MachineInstr *MI);
+                            MachineInstr *MI, bool &isLoad);
 
     /// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
     /// slot / to reg or any rematerialized load into ith operand of specified