Use instruction itinerary to determine what instructions are 'cheap'.
[oota-llvm.git] / include / llvm / CodeGen / CalcSpillWeights.h
index 99703a1c10a3323c9f01e0595a131fa071a4f1af..24264d7f97f0e7177df61c911f3924e106c0ceb6 100644 (file)
@@ -25,17 +25,17 @@ namespace llvm {
   class VirtRegAuxInfo {
     MachineFunction &mf_;
     LiveIntervals &lis_;
-    MachineLoopInfo &loops_;
+    const MachineLoopInfo &loops_;
     DenseMap<unsigned, float> hint_;
   public:
     VirtRegAuxInfo(MachineFunction &mf, LiveIntervals &lis,
-                   MachineLoopInfo &loops) :
+                   const MachineLoopInfo &loops) :
       mf_(mf), lis_(lis), loops_(loops) {}
 
-    /// CalculateRegClass - recompute the register class for li from its uses.
+    /// CalculateRegClass - recompute the register class for reg from its uses.
     /// Since the register class can affect the allocation hint, this function
     /// should be called before CalculateWeightAndHint if both are called.
-    void CalculateRegClass(LiveInterval &li);
+    void CalculateRegClass(unsigned reg);
 
     /// CalculateWeightAndHint - (re)compute li's spill weight and allocation
     /// hint.
@@ -48,7 +48,9 @@ namespace llvm {
   public:
     static char ID;
 
-    CalculateSpillWeights() : MachineFunctionPass(ID) {}
+    CalculateSpillWeights() : MachineFunctionPass(ID) {
+      initializeCalculateSpillWeightsPass(*PassRegistry::getPassRegistry());
+    }
 
     virtual void getAnalysisUsage(AnalysisUsage &au) const;