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" 70 const llvm::DebugLoc &StartLoc,
const llvm::DebugLoc &EndLoc);
76 llvm::BasicBlock *
getHeader()
const {
return Header; }
85 llvm::BasicBlock *Header;
102 void push(llvm::BasicBlock *Header,
const llvm::DebugLoc &StartLoc,
103 const llvm::DebugLoc &EndLoc);
109 const llvm::DebugLoc &EndLoc);
119 return hasInfo() ?
getInfo().getAttributes().IsParallel :
false;
124 void InsertHelper(llvm::Instruction *I)
const;
127 void setParallel(
bool Enable =
true) { StagedAttrs.IsParallel = Enable; }
131 StagedAttrs.VectorizeEnable =
132 Enable ? LoopAttributes::Enable : LoopAttributes::Disable;
137 StagedAttrs.DistributeEnable =
138 Enable ? LoopAttributes::Enable : LoopAttributes::Disable;
143 StagedAttrs.UnrollEnable =
State;
157 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.
Information used when generating a structured loop.
LVEnableState UnrollEnable
Value for llvm.loop.unroll.* metadata (enable, disable, or full).
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.
LVEnableState VectorizeEnable
Value for llvm.loop.vectorize.enable metadata.
void setVectorizeWidth(unsigned W)
Set the vectorize width for the next loop pushed.
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.
Dataflow Directional Tag Classes.
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 setVectorizeEnable(bool Enable=true)
Set the next pushed loop 'vectorize.enable'.
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.