[llvm-commits] [llvm] r52652 - /llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h

Evan Cheng evan.cheng at apple.com
Mon Jun 23 16:58:01 PDT 2008


Please use 1000 / InstrSlots::NUM instead of 250. Also, please mark  
the function "const".

Evan

On Jun 23, 2008, at 4:25 PM, Owen Anderson wrote:

> Author: resistor
> Date: Mon Jun 23 18:25:37 2008
> New Revision: 52652
>
> URL: http://llvm.org/viewvc/llvm-project?rev=52652&view=rev
> Log:
> Add getScaledIntervalSize, which gives a measure of the size of an  
> interval that is independent of the scaling of
> the function due to empty index slots.  This is suitable for use in  
> backend heuristics that need to reason about the density
> of an interval.
>
> Modified:
>    llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
>
> Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=52652&r1=52651&r2=52652&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Mon Jun  
> 23 18:25:37 2008
> @@ -169,6 +169,15 @@
>       return MBB2IdxMap[MBBNo].second;
>     }
>
> +    /// 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) {
> +      // Factor of 250 comes from 1000 units per function divided
> +      // by four slots per instruction.
> +      return (250 * I.getSize()) / i2miMap_.size();
> +    }
> +
>     /// getMBBFromIndex - given an index in any instruction of an
>     /// MBB return a pointer the MBB
>     MachineBasicBlock* getMBBFromIndex(unsigned index) const {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list