Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
authorOwen Anderson <resistor@mac.com>
Tue, 24 Jun 2008 00:08:35 +0000 (00:08 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 24 Jun 2008 00:08:35 +0000 (00:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52659 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveIntervalAnalysis.h

index 92c3b844c9cf53b3e67447da8dd2dd845a106151..32f157f0c1d2b9a17310b2ce6afb3d8638b69363 100644 (file)
@@ -172,10 +172,10 @@ namespace llvm {
     /// getIntervalSize - get the size of an interval in "units,"
     /// where every function is composed of one thousand units.  This
     /// measure scales properly with empty index slots in the function.
-    unsigned getScaledIntervalSize(LiveInterval& I) {
+    unsigned getScaledIntervalSize(LiveInterval& I) const {
       // Factor of 250 comes from 1000 units per function divided
       // by four slots per instruction.
-      return (250 * I.getSize()) / i2miMap_.size();
+      return (1000 / InstrSlots::NUM * I.getSize()) / i2miMap_.size();
     }
 
     /// getMBBFromIndex - given an index in any instruction of an