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/Value.h"
22 #include "llvm/Support/Compiler.h"
65 llvm::BasicBlock *
getHeader()
const {
return Header; }
74 llvm::BasicBlock *Header;
91 void push(llvm::BasicBlock *Header,
126 bool hasInfo()
const {
return !Active.empty(); }
129 const LoopInfo &getInfo()
const {
return Active.back(); }
131 LoopAttributes StagedAttrs;
void setVectorizerWidth(unsigned W)
Set the vectorizer width for the next loop pushed.
Attributes that may be specified on loops.
Information used when generating a structured loop.
void setVectorizerEnable(bool Enable=true)
Set the next pushed loop 'vectorizer.enable'.
LoopAttributes(bool IsParallel=false)
void setVectorizerUnroll(unsigned U)
Set the vectorizer unroll for the next loop pushed.
llvm::BasicBlock * getHeader() const
Get the header block of this loop.
void pop()
End the current loop.
unsigned VectorizerUnroll
llvm.loop.interleave.count
LVEnableState VectorizerEnable
llvm.loop.vectorize.enable
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 setParallel(bool Enable=true)
Set the next pushed loop as parallel.
unsigned VectorizerWidth
llvm.loop.vectorize.width
LoopInfo(llvm::BasicBlock *Header, const LoopAttributes &Attrs)
Construct a new LoopInfo for the loop with entry Header.
A stack of loop information corresponding to loop nesting levels. This stack can be used to prepare a...
LVEnableState
Values of llvm.loop.vectorize.enable metadata.
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.
llvm::MDNode * getCurLoopID() const
Return the top loop id metadata.
void push(llvm::BasicBlock *Header, llvm::ArrayRef< const Attr * > Attrs=llvm::None)
Begin a new structured loop. The set of staged attributes will be applied to the loop and then cleare...