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/DenseMap.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/IR/DebugLoc.h"
22 #include "llvm/IR/Value.h"
23 #include "llvm/Support/Compiler.h"
71 llvm::DebugLoc Location);
77 llvm::BasicBlock *
getHeader()
const {
return Header; }
86 llvm::BasicBlock *Header;
103 void push(llvm::BasicBlock *Header,
104 llvm::DebugLoc Location = llvm::DebugLoc());
110 llvm::DebugLoc Location = llvm::DebugLoc());
158 bool hasInfo()
const {
return !Active.empty(); }
161 const LoopInfo &getInfo()
const {
return Active.back(); }
163 LoopAttributes StagedAttrs;
void setUnrollCount(unsigned C)
Set the unroll count for the next loop pushed.
void push(llvm::BasicBlock *Header, llvm::DebugLoc Location=llvm::DebugLoc())
Begin a new structured loop.
Attributes that may be specified on loops.
Information used when generating a structured loop.
LoopAttributes(bool IsParallel=false)
LVEnableState UnrollEnable
Value for llvm.loop.unroll.* metadata (enable, disable, or full).
llvm::BasicBlock * getHeader() const
Get the header block of this loop.
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 pop()
End the current loop.
void setVectorizeWidth(unsigned W)
Set the vectorize width for the next loop pushed.
detail::InMemoryDirectory::const_iterator I
llvm::MDNode * getLoopID() const
Get the loop id metadata for this loop.
bool IsParallel
Generate llvm.loop.parallel metadata for loads and stores.
bool getCurLoopParallel() const
Return true if the top loop is parallel.
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.
void setDistributeState(bool Enable=true)
Set the next pushed loop as a distribution candidate.
LoopInfo(llvm::BasicBlock *Header, const LoopAttributes &Attrs, llvm::DebugLoc Location)
Construct a new LoopInfo for the loop with entry Header.
A stack of loop information corresponding to loop nesting levels.
LVEnableState
State of loop vectorization or unrolling.
void InsertHelper(llvm::Instruction *I) const
Function called by the CodeGenFunction when an instruction is created.
const LoopAttributes & getAttributes() const
Get the set of attributes active for this loop.
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::MDNode * getCurLoopID() const
Return the top loop id metadata.