Estimated cache‐line cost of loops in a nest.

Synopsis

Declared in <llvm/Analysis/LoopCacheAnalysis.h>

class CacheCost;

Description

CacheCost represents the estimated cost of a inner loop as the number of cache lines used by the memory references it contains. The 'cache cost' of a loop 'L' in a loop nest 'LN' is computed as the sum of the cache costs of all of its reference groups when the loop is considered to be in the innermost position in the nest. A reference group represents memory references that fall into the same cache line. Each reference group is analysed with respect to the innermost loop in a loop nest. The cost of a reference is defined as follow:

  • one if it is loop invariant w.r.t the innermost loop,

  • equal to the loop trip count divided by the cache line times the reference stride if the reference stride is less than the cache line size (CLS), and the coefficient of this loop's index variable used in all other subscripts is zero (e.g. RefCost = TripCount/(CLS/RefStride))

  • equal to the innermost loop trip count if the reference stride is greater or equal to the cache line size CLS.

Member Functions

Name

Description

CacheCost [constructor]

Construct a CacheCost for the loop nest described by Loops.

getLoopCost

Return the estimated cost of loop L if the given loop is part of the loop nest associated with this object. Return ‐1 otherwise.

getLoopCosts

Return the estimated ordered loop costs.

Static Member Functions

Name

Description

getCacheCost

Create a CacheCost for the loop nest rooted by Root.

Friends

Name

Description

llvm::operator<<

Write cache cost CC to stream OS.

Created with MrDocs