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;
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
A stack of loop information corresponding to loop nesting levels.
void setPipelineDisabled(bool S)
Set the pipeline disabled state.
void setUnrollCount(unsigned C)
Set the unroll count for the next loop pushed.
void setVectorizeWidth(unsigned W)
Set the vectorize width for the next loop pushed.
void InsertHelper(llvm::Instruction *I) const
Function called by the CodeGenFunction when an instruction is created.
void setDistributeState(bool Enable=true)
Set the next pushed loop as a distribution candidate.
void setParallel(bool Enable=true)
Set the next pushed loop as parallel.
void push(llvm::BasicBlock *Header, clang::ASTContext &Ctx, const clang::CodeGenOptions &CGOpts, llvm::ArrayRef< const Attr * > Attrs, const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc, bool MustProgress=false)
Begin a new structured loop.
void setInterleaveCount(unsigned C)
Set the interleave count for the next loop pushed.
void setUnrollState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll state.
llvm::MDNode * getCurLoopID() const
Return the top loop id metadata.
void setVectorizeScalable(const LoopAttributes::LVEnableState &State)
void setVectorizePredicateState(const LoopAttributes::LVEnableState &State)
Set the next pushed vectorize predicate state.
void pop()
End the current loop.
void push(llvm::BasicBlock *Header, const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc)
Begin a new structured loop.
bool getCurLoopParallel() const
Return true if the top loop is parallel.
void setMustProgress(bool P)
Set no progress for the next loop pushed.
void setUnrollAndJamState(const LoopAttributes::LVEnableState &State)
Set the next pushed loop unroll_and_jam state.
void setUnrollAndJamCount(unsigned C)
Set the unroll count for the next loop pushed.
void setPipelineInitiationInterval(unsigned C)
Set the pipeline initiation interval.
void setVectorizeEnable(bool Enable=true)
Set the next pushed loop 'vectorize.enable'.
Information used when generating a structured loop.
llvm::BasicBlock * getHeader() const
Get the header block of this loop.
llvm::MDNode * getAccessGroup() const
Return this loop's access group or nullptr if it does not have one.
llvm::MDNode * getLoopID() const
Get the loop id metadata for this loop.
void finish()
Create the loop's metadata.
const LoopAttributes & getAttributes() const
Get the set of attributes active for this loop.
@ C
Languages that the frontend can parse and compile.
YAML serialization mapping.
Attributes that may be specified on loops.
unsigned UnrollCount
llvm.unroll.
bool MustProgress
Value for whether the loop is required to make progress.
unsigned InterleaveCount
Value for llvm.loop.interleave.count metadata.
bool IsParallel
Generate llvm.loop.parallel metadata for loads and stores.
LVEnableState VectorizeScalable
LVEnableState UnrollAndJamEnable
Value for llvm.loop.unroll_and_jam.* metadata (enable, disable, or full).
unsigned UnrollAndJamCount
llvm.unroll.
LVEnableState
State of loop vectorization or unrolling.
LVEnableState VectorizePredicateEnable
Value for llvm.loop.vectorize.predicate metadata.
LVEnableState DistributeEnable
Value for llvm.loop.distribute.enable metadata.
bool PipelineDisabled
Value for llvm.loop.pipeline.disable metadata.
LVEnableState UnrollEnable
Value for llvm.loop.unroll.* metadata (enable, disable, or full).
unsigned VectorizeWidth
Value for llvm.loop.vectorize.width metadata.
unsigned PipelineInitiationInterval
Value for llvm.loop.pipeline.iicount metadata.
LVEnableState VectorizeEnable
Value for llvm.loop.vectorize.enable metadata.