Go to the documentation of this file.
14 #ifndef LLVM_CLANG_LIB_CODEGEN_CGLOOPINFO_H
15 #define LLVM_CLANG_LIB_CODEGEN_CGLOOPINFO_H
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/IR/DebugLoc.h"
20 #include "llvm/IR/Value.h"
21 #include "llvm/Support/Compiler.h"
91 const llvm::DebugLoc &StartLoc,
const llvm::DebugLoc &EndLoc,
95 llvm::MDNode *
getLoopID()
const {
return TempLoopID.get(); }
98 llvm::BasicBlock *
getHeader()
const {
return Header; }
112 llvm::TempMDTuple TempLoopID;
114 llvm::BasicBlock *Header;
118 llvm::MDNode *AccGroup =
nullptr;
120 llvm::DebugLoc StartLoc;
122 llvm::DebugLoc EndLoc;
128 llvm::MDNode *UnrollAndJamInnerFollowup =
nullptr;
154 bool &HasUserTransforms);
158 bool &HasUserTransforms);
162 bool &HasUserTransforms);
166 bool &HasUserTransforms);
170 bool &HasUserTransforms);
174 bool &HasUserTransforms);
191 bool &HasUserTransforms);
206 void push(llvm::BasicBlock *Header,
const llvm::DebugLoc &StartLoc,
207 const llvm::DebugLoc &EndLoc);
214 const llvm::DebugLoc &EndLoc,
bool MustProgress =
false);
290 bool hasInfo()
const {
return !Active.empty(); }
293 const LoopInfo &getInfo()
const {
return *Active.back(); }
295 LoopAttributes StagedAttrs;
llvm::MDNode * getCurLoopID() const
Return the top loop id metadata.
bool MustProgress
Value for whether the loop is required to make progress.
llvm::BasicBlock * getHeader() const
Get the header block of this loop.
YAML serialization mapping.
const LoopAttributes & getAttributes() const
Get the set of attributes active for this loop.
void setVectorizePredicateState(const LoopAttributes::LVEnableState &State)
Set the next pushed vectorize predicate state.
unsigned InterleaveCount
Value for llvm.loop.interleave.count metadata.
void setParallel(bool Enable=true)
Set the next pushed loop as parallel.
void setUnrollState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll state.
LVEnableState VectorizeEnable
Value for llvm.loop.vectorize.enable metadata.
unsigned UnrollAndJamCount
llvm.unroll.
LVEnableState UnrollAndJamEnable
Value for llvm.loop.unroll_and_jam.* metadata (enable, disable, or full).
LoopAttributes(bool IsParallel=false)
LVEnableState VectorizeScalable
void InsertHelper(llvm::Instruction *I) const
Function called by the CodeGenFunction when an instruction is created.
unsigned PipelineInitiationInterval
Value for llvm.loop.pipeline.iicount metadata.
LVEnableState VectorizePredicateEnable
Value for llvm.loop.vectorize.predicate metadata.
void setUnrollAndJamCount(unsigned C)
Set the unroll count for the next loop pushed.
void setUnrollAndJamState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll_and_jam state.
bool IsParallel
Generate llvm.loop.parallel metadata for loads and stores.
LVEnableState UnrollEnable
Value for llvm.loop.unroll.* metadata (enable, disable, or full).
void setVectorizeScalable(const LoopAttributes::LVEnableState &State)
LVEnableState DistributeEnable
Value for llvm.loop.distribute.enable metadata.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void setMustProgress(bool P)
Set no progress for the next loop pushed.
void pop()
End the current loop.
bool getCurLoopParallel() const
Return true if the top loop is parallel.
void setVectorizeWidth(unsigned W)
Set the vectorize width for the next loop pushed.
void push(llvm::BasicBlock *Header, const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc)
Begin a new structured loop.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
void finish()
Create the loop's metadata.
void setVectorizeEnable(bool Enable=true)
Set the next pushed loop 'vectorize.enable'.
void setPipelineInitiationInterval(unsigned C)
Set the pipeline initiation interval.
void setUnrollCount(unsigned C)
Set the unroll count for the next loop pushed.
unsigned UnrollCount
llvm.unroll.
llvm::MDNode * getLoopID() const
Get the loop id metadata for this loop.
Attributes that may be specified on loops.
LoopInfo(llvm::BasicBlock *Header, const LoopAttributes &Attrs, const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc, LoopInfo *Parent)
Construct a new LoopInfo for the loop with entry Header.
void setInterleaveCount(unsigned C)
Set the interleave count for the next loop pushed.
Information used when generating a structured loop.
void setDistributeState(bool Enable=true)
Set the next pushed loop as a distribution candidate.
bool PipelineDisabled
Value for llvm.loop.pipeline.disable metadata.
llvm::MDNode * getAccessGroup() const
Return this loop's access group or nullptr if it does not have one.
LVEnableState
State of loop vectorization or unrolling.
unsigned VectorizeWidth
Value for llvm.loop.vectorize.width metadata.
void setPipelineDisabled(bool S)
Set the pipeline disabled state.
A stack of loop information corresponding to loop nesting levels.