LLVM 22.0.0git
IVUsers.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "iv-users"

Functions

 INITIALIZE_PASS_BEGIN (IVUsersWrapperPass, "iv-users", "Induction Variable Users", false, true) INITIALIZE_PASS_END(IVUsersWrapperPass
static bool isInteresting (const SCEV *S, const Instruction *I, const Loop *L, ScalarEvolution *SE, LoopInfo *LI)
 isInteresting - Test whether the given expression is "interesting" when used by the given expression, within the context of analyzing the given loop.
static bool IVUseShouldUsePostIncValue (Instruction *User, Value *Operand, const Loop *L, DominatorTree *DT)
 IVUseShouldUsePostIncValue - We have discovered a "User" of an IV expression and now we need to decide whether the user should use the preinc or post-inc value.
static const SCEVAddRecExprfindAddRecForLoop (const SCEV *S, const Loop *L)

Variables

iv users
iv Induction Variable Users
iv Induction Variable false

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "iv-users"

Definition at line 32 of file IVUsers.cpp.

Function Documentation

◆ findAddRecForLoop()

const SCEVAddRecExpr * findAddRecForLoop ( const SCEV * S,
const Loop * L )
static

Definition at line 339 of file IVUsers.cpp.

References llvm::Add, llvm::dyn_cast(), and findAddRecForLoop().

Referenced by findAddRecForLoop(), and llvm::IVUsers::getStride().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( IVUsersWrapperPass ,
"iv-users" ,
"Induction Variable Users" ,
false ,
true  )

◆ isInteresting()

◆ IVUseShouldUsePostIncValue()

bool IVUseShouldUsePostIncValue ( Instruction * User,
Value * Operand,
const Loop * L,
DominatorTree * DT )
static

IVUseShouldUsePostIncValue - We have discovered a "User" of an IV expression and now we need to decide whether the user should use the preinc or post-inc value.

If this user should use the post-inc version of the IV, return true.

Choosing wrong here can break dominance properties (if we choose to use the post-inc value when we cannot) or it can end up adding extra live-ranges to the loop, resulting in reg-reg copies (if we use the pre-inc value when we should use the post-inc value).

Definition at line 97 of file IVUsers.cpp.

References llvm::DominatorTree::dominates(), llvm::dyn_cast(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), and llvm::PHINode::getNumIncomingValues().

Referenced by llvm::IVUsers::AddUsersIfInteresting().

Variable Documentation

◆ false

iv Induction Variable false

Definition at line 49 of file IVUsers.cpp.

◆ Users

◆ users