Simplify LiveIntervals::getApproximateInstructionCount().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 25 Apr 2012 16:32:23 +0000 (16:32 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 25 Apr 2012 16:32:23 +0000 (16:32 +0000)
This function is only used for a heuristic during -join-physregs. It
doesn't need floating point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155554 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveIntervalAnalysis.h

index 9329338976e7b6f13494446d5459cc53a2865614..c3c6e2d15cb244039fe4e22c01ad7ff989453e14 100644 (file)
@@ -147,8 +147,7 @@ namespace llvm {
     /// getApproximateInstructionCount - computes an estimate of the number
     /// of instructions in a given LiveInterval.
     unsigned getApproximateInstructionCount(LiveInterval& I) {
-      double IntervalPercentage = getScaledIntervalSize(I) / 1000.0;
-      return (unsigned)(IntervalPercentage * indexes_->getFunctionSize());
+      return I.getSize()/SlotIndex::InstrDist;
     }
 
     // Interval creation