class ScalarEvolution::BackedgeTakenInfo

Declaration

class ScalarEvolution::BackedgeTakenInfo { /* full declaration omitted */ };

Description

Information about the backedge-taken count of a loop. This currently includes an exact count and a maximum count.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1268

Method Overview

  • public BackedgeTakenInfo()
  • public BackedgeTakenInfo(llvm::ScalarEvolution::BackedgeTakenInfo &&)
  • public BackedgeTakenInfo(ArrayRef<llvm::ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo> ExitCounts, bool Complete, const llvm::SCEV * MaxCount, bool MaxOrZero)
  • public void clear()
  • public const llvm::SCEV * getExact(const llvm::Loop * L, llvm::ScalarEvolution * SE, llvm::SCEVUnionPredicate * Predicates = nullptr) const
  • public const llvm::SCEV * getExact(llvm::BasicBlock * ExitingBlock, llvm::ScalarEvolution * SE) const
  • public const llvm::SCEV * getMax(llvm::ScalarEvolution * SE) const
  • public const llvm::SCEV * getMax(llvm::BasicBlock * ExitingBlock, llvm::ScalarEvolution * SE) const
  • public bool hasAnyInfo() const
  • public bool hasFullInfo() const
  • public bool hasOperand(const llvm::SCEV * S, llvm::ScalarEvolution * SE) const
  • public bool isMaxOrZero(llvm::ScalarEvolution * SE) const

Methods

BackedgeTakenInfo()

Description

@ }

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1292

BackedgeTakenInfo(
    llvm::ScalarEvolution::BackedgeTakenInfo&&)

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1293

Parameters

llvm::ScalarEvolution::BackedgeTakenInfo&&

BackedgeTakenInfo(
    ArrayRef<llvm::ScalarEvolution::
                 BackedgeTakenInfo::EdgeExitInfo>
        ExitCounts,
    bool Complete,
    const llvm::SCEV* MaxCount,
    bool MaxOrZero)

Description

Initialize BackedgeTakenInfo from a list of exact exit counts.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1299

Parameters

ArrayRef<llvm::ScalarEvolution:: BackedgeTakenInfo::EdgeExitInfo> ExitCounts
bool Complete
const llvm::SCEV* MaxCount
bool MaxOrZero

void clear()

Description

Invalidate this result and free associated memory.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1353

const llvm::SCEV* getExact(
    const llvm::Loop* L,
    llvm::ScalarEvolution* SE,
    llvm::SCEVUnionPredicate* Predicates =
        nullptr) const

Description

Return an expression indicating the exact *backedge-taken* count of the loop if it is known or SCEVCouldNotCompute otherwise. If execution makes it to the backedge on every iteration (i.e. there are no abnormal exists like exception throws and thread exits) then this is the number of times the loop header will execute minus one. If the SCEV predicate associated with the answer can be different from AlwaysTrue, we must add a (non null) Predicates argument. The SCEV predicate associated with the answer will be added to Predicates. A run-time check needs to be emitted for the SCEV predicate in order for the answer to be valid. Note that we should always know if we need to pass a predicate argument or not from the way the ExitCounts vector was computed. If we allowed SCEV predicates to be generated when populating this vector, this information can contain them and therefore a SCEVPredicate argument should be added to getExact.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1329

Parameters

const llvm::Loop* L
llvm::ScalarEvolution* SE
llvm::SCEVUnionPredicate* Predicates = nullptr

const llvm::SCEV* getExact(
    llvm::BasicBlock* ExitingBlock,
    llvm::ScalarEvolution* SE) const

Description

Return the number of times this loop exit may fall through to the back edge, or SCEVCouldNotCompute. The loop is guaranteed not to exit via this block before this number of iterations, but may exit via another block.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1336

Parameters

llvm::BasicBlock* ExitingBlock
llvm::ScalarEvolution* SE

const llvm::SCEV* getMax(
    llvm::ScalarEvolution* SE) const

Description

Get the max backedge taken count for the loop.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1339

Parameters

llvm::ScalarEvolution* SE

const llvm::SCEV* getMax(
    llvm::BasicBlock* ExitingBlock,
    llvm::ScalarEvolution* SE) const

Description

Get the max backedge taken count for the particular loop exit.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1342

Parameters

llvm::BasicBlock* ExitingBlock
llvm::ScalarEvolution* SE

bool hasAnyInfo() const

Description

Test whether this BackedgeTakenInfo contains any computed information, or whether it's all SCEVCouldNotCompute values.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1304

bool hasFullInfo() const

Description

Test whether this BackedgeTakenInfo contains complete information.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1309

bool hasOperand(const llvm::SCEV* S,
                llvm::ScalarEvolution* SE) const

Description

Return true if any backedge taken count expressions refer to the given subexpression.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1350

Parameters

const llvm::SCEV* S
llvm::ScalarEvolution* SE

bool isMaxOrZero(llvm::ScalarEvolution* SE) const

Description

Return true if the number of times this backedge is taken is either the value returned by getMax or zero.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1346

Parameters

llvm::ScalarEvolution* SE