15 #ifndef LLVM_CLANG_LIB_CODEGEN_CGLOOPINFO_H 16 #define LLVM_CLANG_LIB_CODEGEN_CGLOOPINFO_H 18 #include "llvm/ADT/ArrayRef.h" 19 #include "llvm/ADT/SmallVector.h" 20 #include "llvm/IR/DebugLoc.h" 21 #include "llvm/IR/Value.h" 22 #include "llvm/Support/Compiler.h" 82 const llvm::DebugLoc &StartLoc,
const llvm::DebugLoc &EndLoc);
88 llvm::BasicBlock *
getHeader()
const {
return Header; }
100 llvm::BasicBlock *Header;
104 llvm::MDNode *AccGroup =
nullptr;
119 void push(llvm::BasicBlock *Header,
const llvm::DebugLoc &StartLoc,
120 const llvm::DebugLoc &EndLoc);
126 const llvm::DebugLoc &EndLoc);
136 return hasInfo() ?
getInfo().getAttributes().IsParallel :
false;
141 void InsertHelper(llvm::Instruction *I)
const;
144 void setParallel(
bool Enable =
true) { StagedAttrs.IsParallel = Enable; }
148 StagedAttrs.VectorizeEnable =
149 Enable ? LoopAttributes::Enable : LoopAttributes::Disable;
154 StagedAttrs.DistributeEnable =
155 Enable ? LoopAttributes::Enable : LoopAttributes::Disable;
160 StagedAttrs.UnrollEnable =
State;
165 StagedAttrs.UnrollAndJamEnable =
State;
185 StagedAttrs.PipelineInitiationInterval = C;
190 bool hasInfo()
const {
return !Active.empty(); }
void setUnrollCount(unsigned C)
Set the unroll count for the next loop pushed.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Attributes that may be specified on loops.
unsigned UnrollAndJamCount
llvm.unroll.
Information used when generating a structured loop.
LVEnableState UnrollEnable
Value for llvm.loop.unroll.* metadata (enable, disable, or full).
unsigned PipelineInitiationInterval
Value for llvm.loop.pipeline.iicount metadata.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
unsigned InterleaveCount
Value for llvm.loop.interleave.count metadata.
void setUnrollAndJamCount(unsigned C)
Set the unroll count for the next loop pushed.
LVEnableState VectorizeEnable
Value for llvm.loop.vectorize.enable metadata.
void setVectorizeWidth(unsigned W)
Set the vectorize width for the next loop pushed.
LVEnableState UnrollAndJamEnable
Value for llvm.loop.unroll_and_jam.* metadata (enable, disable, or full).
bool IsParallel
Generate llvm.loop.parallel metadata for loads and stores.
void setInterleaveCount(unsigned C)
Set the interleave count for the next loop pushed.
unsigned UnrollCount
llvm.unroll.
void setParallel(bool Enable=true)
Set the next pushed loop as parallel.
LVEnableState DistributeEnable
Value for llvm.loop.distribute.enable metadata.
llvm::MDNode * getLoopID() const
Get the loop id metadata for this loop.
llvm::MDNode * getCurLoopID() const
Return the top loop id metadata.
void setDistributeState(bool Enable=true)
Set the next pushed loop as a distribution candidate.
llvm::MDNode * getAccessGroup() const
Return this loop's access group or nullptr if it does not have one.
Dataflow Directional Tag Classes.
bool PipelineDisabled
Value for llvm.loop.pipeline.disable metadata.
static const TypeInfo & getInfo(unsigned id)
A stack of loop information corresponding to loop nesting levels.
bool getCurLoopParallel() const
Return true if the top loop is parallel.
LVEnableState
State of loop vectorization or unrolling.
void setUnrollState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll state.
void setUnrollAndJamState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll_and_jam state.
void setVectorizeEnable(bool Enable=true)
Set the next pushed loop 'vectorize.enable'.
void setPipelineDisabled(bool S)
Set the pipeline disabled state.
void setPipelineInitiationInterval(unsigned C)
Set the pipeline initiation interval.
unsigned VectorizeWidth
Value for llvm.loop.vectorize.width metadata.
llvm::BasicBlock * getHeader() const
Get the header block of this loop.
const LoopAttributes & getAttributes() const
Get the set of attributes active for this loop.