clang 20.0.0git
Public Member Functions | List of all members
clang::CodeGen::LoopInfoStack Class Reference

A stack of loop information corresponding to loop nesting levels. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGLoopInfo.h"

Public Member Functions

 LoopInfoStack ()
 
void push (llvm::BasicBlock *Header, const llvm::DebugLoc &StartLoc, const llvm::DebugLoc &EndLoc)
 Begin a new structured loop.
 
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 pop ()
 End the current loop.
 
llvm::MDNode * getCurLoopID () const
 Return the top loop id metadata.
 
bool getCurLoopParallel () const
 Return true if the top loop is parallel.
 
void InsertHelper (llvm::Instruction *I) const
 Function called by the CodeGenFunction when an instruction is created.
 
void setParallel (bool Enable=true)
 Set the next pushed loop as parallel.
 
void setVectorizeEnable (bool Enable=true)
 Set the next pushed loop 'vectorize.enable'.
 
void setDistributeState (bool Enable=true)
 Set the next pushed loop as a distribution candidate.
 
void setUnrollState (const LoopAttributes::LVEnableState &State)
 Set the next pushed loop unroll state.
 
void setVectorizePredicateState (const LoopAttributes::LVEnableState &State)
 Set the next pushed vectorize predicate state.
 
void setUnrollAndJamState (const LoopAttributes::LVEnableState &State)
 Set the next pushed loop unroll_and_jam state.
 
void setVectorizeWidth (unsigned W)
 Set the vectorize width for the next loop pushed.
 
void setVectorizeScalable (const LoopAttributes::LVEnableState &State)
 
void setInterleaveCount (unsigned C)
 Set the interleave count for the next loop pushed.
 
void setUnrollCount (unsigned C)
 Set the unroll count for the next loop pushed.
 
void setUnrollAndJamCount (unsigned C)
 Set the unroll count for the next loop pushed.
 
void setPipelineDisabled (bool S)
 Set the pipeline disabled state.
 
void setPipelineInitiationInterval (unsigned C)
 Set the pipeline initiation interval.
 
void setCodeAlign (unsigned C)
 Set value of code align for the next loop pushed.
 
void setMustProgress (bool P)
 Set no progress for the next loop pushed.
 
bool hasInfo () const
 Returns true if there is LoopInfo on the stack.
 
const LoopInfogetInfo () const
 Return the LoopInfo for the current loop.
 

Detailed Description

A stack of loop information corresponding to loop nesting levels.

This stack can be used to prepare attributes which are applied when a loop is emitted.

Definition at line 204 of file CGLoopInfo.h.

Constructor & Destructor Documentation

◆ LoopInfoStack()

clang::CodeGen::LoopInfoStack::LoopInfoStack ( )
inline

Definition at line 209 of file CGLoopInfo.h.

Member Function Documentation

◆ getCurLoopID()

llvm::MDNode * clang::CodeGen::LoopInfoStack::getCurLoopID ( ) const
inline

Return the top loop id metadata.

Definition at line 227 of file CGLoopInfo.h.

References getInfo(), and clang::CodeGen::LoopInfo::getLoopID().

◆ getCurLoopParallel()

bool clang::CodeGen::LoopInfoStack::getCurLoopParallel ( ) const
inline

Return true if the top loop is parallel.

Definition at line 230 of file CGLoopInfo.h.

References clang::CodeGen::LoopInfo::getAttributes(), getInfo(), hasInfo(), and clang::CodeGen::LoopAttributes::IsParallel.

◆ getInfo()

const LoopInfo & clang::CodeGen::LoopInfoStack::getInfo ( ) const
inline

Return the LoopInfo for the current loop.

HasInfo should be called first to ensure LoopInfo is present.

Definition at line 302 of file CGLoopInfo.h.

Referenced by getCurLoopID(), getCurLoopParallel(), and InsertHelper().

◆ hasInfo()

bool clang::CodeGen::LoopInfoStack::hasInfo ( ) const
inline

Returns true if there is LoopInfo on the stack.

Definition at line 299 of file CGLoopInfo.h.

Referenced by getCurLoopParallel(), and InsertHelper().

◆ InsertHelper()

void LoopInfoStack::InsertHelper ( llvm::Instruction *  I) const

Function called by the CodeGenFunction when an instruction is created.

Definition at line 840 of file CGLoopInfo.cpp.

References clang::CodeGen::LoopInfo::getHeader(), getInfo(), clang::CodeGen::LoopInfo::getLoopID(), and hasInfo().

◆ pop()

void LoopInfoStack::pop ( )

End the current loop.

Definition at line 834 of file CGLoopInfo.cpp.

◆ push() [1/2]

void clang::CodeGen::LoopInfoStack::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.

Stage attributes from the Attrs list. The staged attributes are applied to the loop and then cleared.

◆ push() [2/2]

void clang::CodeGen::LoopInfoStack::push ( llvm::BasicBlock *  Header,
const llvm::DebugLoc &  StartLoc,
const llvm::DebugLoc &  EndLoc 
)

Begin a new structured loop.

The set of staged attributes will be applied to the loop and then cleared.

◆ setCodeAlign()

void clang::CodeGen::LoopInfoStack::setCodeAlign ( unsigned  C)
inline

Set value of code align for the next loop pushed.

Definition at line 293 of file CGLoopInfo.h.

References clang::C, and clang::CodeGen::LoopAttributes::CodeAlign.

◆ setDistributeState()

void clang::CodeGen::LoopInfoStack::setDistributeState ( bool  Enable = true)
inline

Set the next pushed loop as a distribution candidate.

Definition at line 248 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::Disable, clang::CodeGen::LoopAttributes::DistributeEnable, and clang::CodeGen::LoopAttributes::Enable.

◆ setInterleaveCount()

void clang::CodeGen::LoopInfoStack::setInterleaveCount ( unsigned  C)
inline

Set the interleave count for the next loop pushed.

Definition at line 276 of file CGLoopInfo.h.

References clang::C, and clang::CodeGen::LoopAttributes::InterleaveCount.

◆ setMustProgress()

void clang::CodeGen::LoopInfoStack::setMustProgress ( bool  P)
inline

Set no progress for the next loop pushed.

Definition at line 296 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::MustProgress, and P.

◆ setParallel()

void clang::CodeGen::LoopInfoStack::setParallel ( bool  Enable = true)
inline

Set the next pushed loop as parallel.

Definition at line 239 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::IsParallel.

Referenced by emitSimdlenSafelenClause().

◆ setPipelineDisabled()

void clang::CodeGen::LoopInfoStack::setPipelineDisabled ( bool  S)
inline

Set the pipeline disabled state.

Definition at line 285 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::PipelineDisabled.

◆ setPipelineInitiationInterval()

void clang::CodeGen::LoopInfoStack::setPipelineInitiationInterval ( unsigned  C)
inline

Set the pipeline initiation interval.

Definition at line 288 of file CGLoopInfo.h.

References clang::C, and clang::CodeGen::LoopAttributes::PipelineInitiationInterval.

◆ setUnrollAndJamCount()

void clang::CodeGen::LoopInfoStack::setUnrollAndJamCount ( unsigned  C)
inline

Set the unroll count for the next loop pushed.

Definition at line 282 of file CGLoopInfo.h.

References clang::C, and clang::CodeGen::LoopAttributes::UnrollAndJamCount.

◆ setUnrollAndJamState()

void clang::CodeGen::LoopInfoStack::setUnrollAndJamState ( const LoopAttributes::LVEnableState State)
inline

Set the next pushed loop unroll_and_jam state.

Definition at line 264 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::UnrollAndJamEnable.

◆ setUnrollCount()

void clang::CodeGen::LoopInfoStack::setUnrollCount ( unsigned  C)
inline

Set the unroll count for the next loop pushed.

Definition at line 279 of file CGLoopInfo.h.

References clang::C, and clang::CodeGen::LoopAttributes::UnrollCount.

◆ setUnrollState()

void clang::CodeGen::LoopInfoStack::setUnrollState ( const LoopAttributes::LVEnableState State)
inline

Set the next pushed loop unroll state.

Definition at line 254 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::UnrollEnable.

◆ setVectorizeEnable()

void clang::CodeGen::LoopInfoStack::setVectorizeEnable ( bool  Enable = true)
inline

Set the next pushed loop 'vectorize.enable'.

Definition at line 242 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::Disable, clang::CodeGen::LoopAttributes::Enable, and clang::CodeGen::LoopAttributes::VectorizeEnable.

Referenced by emitCommonSimdLoop().

◆ setVectorizePredicateState()

void clang::CodeGen::LoopInfoStack::setVectorizePredicateState ( const LoopAttributes::LVEnableState State)
inline

Set the next pushed vectorize predicate state.

Definition at line 259 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::VectorizePredicateEnable.

◆ setVectorizeScalable()

void clang::CodeGen::LoopInfoStack::setVectorizeScalable ( const LoopAttributes::LVEnableState State)
inline

Definition at line 271 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::VectorizeScalable.

◆ setVectorizeWidth()

void clang::CodeGen::LoopInfoStack::setVectorizeWidth ( unsigned  W)
inline

Set the vectorize width for the next loop pushed.

Definition at line 269 of file CGLoopInfo.h.

References clang::CodeGen::LoopAttributes::VectorizeWidth.

Referenced by emitSimdlenSafelenClause().


The documentation for this class was generated from the following files: