From: Jakob Stoklund Olesen Date: Wed, 25 Apr 2012 16:32:23 +0000 (+0000) Subject: Simplify LiveIntervals::getApproximateInstructionCount(). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=50e1d84ba8efc1973137c65e0b0e048ecf8cf5d6;p=oota-llvm.git Simplify LiveIntervals::getApproximateInstructionCount(). 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 --- diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index 9329338976e..c3c6e2d15cb 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -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