Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
LoopFlatten.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loop-flatten"

Functions

 STATISTIC (NumFlattened, "Number of loops flattened")
static bool setLoopComponents (Value *&TC, Value *&TripCount, BinaryOperator *&Increment, SmallPtrSetImpl< Instruction * > &IterationInstructions)
static bool verifyTripCount (Value *RHS, Loop *L, SmallPtrSetImpl< Instruction * > &IterationInstructions, PHINode *&InductionPHI, Value *&TripCount, BinaryOperator *&Increment, BranchInst *&BackBranch, ScalarEvolution *SE, bool IsWidened)
static bool findLoopComponents (Loop *L, SmallPtrSetImpl< Instruction * > &IterationInstructions, PHINode *&InductionPHI, Value *&TripCount, BinaryOperator *&Increment, BranchInst *&BackBranch, ScalarEvolution *SE, bool IsWidened)
static bool checkPHIs (FlattenInfo &FI, const TargetTransformInfo *TTI)
static bool checkOuterLoopInsts (FlattenInfo &FI, SmallPtrSetImpl< Instruction * > &IterationInstructions, const TargetTransformInfo *TTI)
static bool checkIVUsers (FlattenInfo &FI)
static OverflowResult checkOverflow (FlattenInfo &FI, DominatorTree *DT, AssumptionCache *AC)
static bool CanFlattenLoopPair (FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE, AssumptionCache *AC, const TargetTransformInfo *TTI)
static bool DoFlattenLoopPair (FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE, AssumptionCache *AC, const TargetTransformInfo *TTI, LPMUpdater *U, MemorySSAUpdater *MSSAU)
static bool CanWidenIV (FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE, AssumptionCache *AC, const TargetTransformInfo *TTI)
static bool FlattenLoopPair (FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE, AssumptionCache *AC, const TargetTransformInfo *TTI, LPMUpdater *U, MemorySSAUpdater *MSSAU, const LoopAccessInfo &LAI)

Variables

static cl::opt< unsignedRepeatedInstructionThreshold ("loop-flatten-cost-threshold", cl::Hidden, cl::init(2), cl::desc("Limit on the cost of instructions that can be repeated due to " "loop flattening"))
static cl::opt< boolAssumeNoOverflow ("loop-flatten-assume-no-overflow", cl::Hidden, cl::init(false), cl::desc("Assume that the product of the two iteration " "trip counts will never overflow"))
static cl::opt< boolWidenIV ("loop-flatten-widen-iv", cl::Hidden, cl::init(true), cl::desc("Widen the loop induction variables, if possible, so " "overflow checks won't reject flattening"))
static cl::opt< boolVersionLoops ("loop-flatten-version-loops", cl::Hidden, cl::init(true), cl::desc("Version loops if flattened loop could overflow"))

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loop-flatten"

Definition at line 81 of file LoopFlatten.cpp.

Function Documentation

◆ CanFlattenLoopPair()

◆ CanWidenIV()

◆ checkIVUsers()

bool checkIVUsers ( FlattenInfo & FI)
static

Definition at line 620 of file LoopFlatten.cpp.

References llvm::dbgs(), and LLVM_DEBUG.

Referenced by CanFlattenLoopPair().

◆ checkOuterLoopInsts()

◆ checkOverflow()

◆ checkPHIs()

◆ DoFlattenLoopPair()

◆ findLoopComponents()

◆ FlattenLoopPair()

◆ setLoopComponents()

bool setLoopComponents ( Value *& TC,
Value *& TripCount,
BinaryOperator *& Increment,
SmallPtrSetImpl< Instruction * > & IterationInstructions )
static

◆ STATISTIC()

STATISTIC ( NumFlattened ,
"Number of loops flattened"  )

◆ verifyTripCount()

Variable Documentation

◆ AssumeNoOverflow

cl::opt< bool > AssumeNoOverflow("loop-flatten-assume-no-overflow", cl::Hidden, cl::init(false), cl::desc("Assume that the product of the two iteration " "trip counts will never overflow")) ( "loop-flatten-assume-no-overflow" ,
cl::Hidden ,
cl::init(false) ,
cl::desc("Assume that the product of the two iteration " "trip counts will never overflow")  )
static

Referenced by checkOverflow().

◆ RepeatedInstructionThreshold

cl::opt< unsigned > RepeatedInstructionThreshold("loop-flatten-cost-threshold", cl::Hidden, cl::init(2), cl::desc("Limit on the cost of instructions that can be repeated due to " "loop flattening")) ( "loop-flatten-cost-threshold" ,
cl::Hidden ,
cl::init(2) ,
cl::desc("Limit on the cost of instructions that can be repeated due to " "loop flattening")  )
static

Referenced by checkOuterLoopInsts().

◆ VersionLoops

cl::opt< bool > VersionLoops("loop-flatten-version-loops", cl::Hidden, cl::init(true), cl::desc("Version loops if flattened loop could overflow")) ( "loop-flatten-version-loops" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Version loops if flattened loop could overflow")  )
static

Referenced by FlattenLoopPair().

◆ WidenIV

WidenIV::WidenIV ( "loop-flatten-widen-iv" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Widen the loop induction variables, if possible, so " "overflow checks won't reject flattening")  )
static

Definition at line 1227 of file SimplifyIndVar.cpp.