clang  19.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/runner/work/llvm/llvm/repo/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. More...
 
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. More...
 
void pop ()
 End the current loop. More...
 
llvm::MDNode * getCurLoopID () const
 Return the top loop id metadata. More...
 
bool getCurLoopParallel () const
 Return true if the top loop is parallel. More...
 
void InsertHelper (llvm::Instruction *I) const
 Function called by the CodeGenFunction when an instruction is created. More...
 
void setParallel (bool Enable=true)
 Set the next pushed loop as parallel. More...
 
void setVectorizeEnable (bool Enable=true)
 Set the next pushed loop 'vectorize.enable'. More...
 
void setDistributeState (bool Enable=true)
 Set the next pushed loop as a distribution candidate. More...
 
void setUnrollState (const LoopAttributes::LVEnableState &State)
 Set the next pushed loop unroll state. More...
 
void setVectorizePredicateState (const LoopAttributes::LVEnableState &State)
 Set the next pushed vectorize predicate state. More...
 
void setUnrollAndJamState (const LoopAttributes::LVEnableState &State)
 Set the next pushed loop unroll_and_jam state. More...
 
void setVectorizeWidth (unsigned W)
 Set the vectorize width for the next loop pushed. More...
 
void setVectorizeScalable (const LoopAttributes::LVEnableState &State)
 
void setInterleaveCount (unsigned C)
 Set the interleave count for the next loop pushed. More...
 
void addSYCLIVDepInfo (llvm::LLVMContext &Ctx, unsigned SafeLen, const ValueDecl *Array)
 Add a safelen value for the next loop pushed. More...
 
void addIVDepMetadata (const ValueDecl *Array, llvm::Instruction *GEP)
 
void setSYCLIInterval (unsigned C)
 Set value of an initiation interval for the next loop pushed. More...
 
void setSYCLMaxConcurrencyNThreads (unsigned C)
 Set value of max_concurrency for the next loop pushed. More...
 
void setSYCLLoopCoalesceEnable ()
 Set flag of loop_coalesce for the next loop pushed. More...
 
void setSYCLLoopCoalesceNLevels (unsigned C)
 Set value of coalesced levels for the next loop pushed. More...
 
void setSYCLLoopPipeliningDisable ()
 Set flag of disable_loop_pipelining for the next loop pushed. More...
 
void setSYCLMaxInterleavingNInvocations (unsigned C)
 Set value of max interleaved invocations for the next loop pushed. More...
 
void setSYCLSpeculatedIterationsNIterations (unsigned C)
 Set value of speculated iterations for the next loop pushed. More...
 
void setSYCLIntelFPGAVariantCount (const char *Var, unsigned int Count)
 Set value of variant and loop count for the next loop pushed. More...
 
void setUnrollCount (unsigned C)
 Set the unroll count for the next loop pushed. More...
 
void setUnrollAndJamCount (unsigned C)
 Set the unroll count for the next loop pushed. More...
 
void setPipelineDisabled (bool S)
 Set the pipeline disabled state. More...
 
void setPipelineInitiationInterval (unsigned C)
 Set the pipeline initiation interval. More...
 
void setSYCLNofusionEnable ()
 Set flag of nofusion for the next loop pushed. More...
 
void setCodeAlign (unsigned C)
 Set value of code align for the next loop pushed. More...
 
void setMustProgress (bool P)
 Set no progress for the next loop pushed. More...
 
void setSYCLMaxReinvocationDelayNCycles (unsigned C)
 Set value of max reinvocation delay for the next loop pushed. More...
 
void setSYCLLoopPipeliningEnable ()
 Set flag of enable_loop_pipelining for the next loop pushed. More...
 
bool hasInfo () const
 Returns true if there is LoopInfo on the stack. More...
 
const LoopInfogetInfo () const
 Return the LoopInfo for the current loop. More...
 

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 287 of file CGLoopInfo.h.

Constructor & Destructor Documentation

◆ LoopInfoStack()

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

Definition at line 292 of file CGLoopInfo.h.

Member Function Documentation

◆ addIVDepMetadata()

void LoopInfoStack::addIVDepMetadata ( const ValueDecl Array,
llvm::Instruction *  GEP 
)

Definition at line 1227 of file CGLoopInfo.cpp.

References clang::CodeGen::LoopInfo::addIVDepMetadata(), Array, getInfo(), and hasInfo().

Referenced by AddIVDepMetadata().

◆ addSYCLIVDepInfo()

void LoopInfoStack::addSYCLIVDepInfo ( llvm::LLVMContext &  Ctx,
unsigned  SafeLen,
const ValueDecl Array 
)

Add a safelen value for the next loop pushed.

Definition at line 418 of file CGLoopInfo.cpp.

References Array, and SafeLen.

◆ getCurLoopID()

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

Return the top loop id metadata.

Definition at line 310 of file CGLoopInfo.h.

References getInfo().

◆ getCurLoopParallel()

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

Return true if the top loop is parallel.

Definition at line 313 of file CGLoopInfo.h.

References getInfo().

◆ 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 442 of file CGLoopInfo.h.

Referenced by addIVDepMetadata(), and InsertHelper().

◆ hasInfo()

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

Returns true if there is LoopInfo on the stack.

Definition at line 439 of file CGLoopInfo.h.

Referenced by addIVDepMetadata(), and InsertHelper().

◆ InsertHelper()

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

Function called by the CodeGenFunction when an instruction is created.

Definition at line 1156 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 1150 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 423 of file CGLoopInfo.h.

◆ setDistributeState()

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

Set the next pushed loop as a distribution candidate.

Definition at line 331 of file CGLoopInfo.h.

◆ setInterleaveCount()

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

Set the interleave count for the next loop pushed.

Definition at line 359 of file CGLoopInfo.h.

◆ setMustProgress()

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

Set no progress for the next loop pushed.

Definition at line 426 of file CGLoopInfo.h.

References P.

◆ setParallel()

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

Set the next pushed loop as parallel.

Definition at line 322 of file CGLoopInfo.h.

Referenced by emitSimdlenSafelenClause().

◆ setPipelineDisabled()

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

Set the pipeline disabled state.

Definition at line 412 of file CGLoopInfo.h.

◆ setPipelineInitiationInterval()

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

Set the pipeline initiation interval.

Definition at line 415 of file CGLoopInfo.h.

◆ setSYCLIInterval()

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

Set value of an initiation interval for the next loop pushed.

Definition at line 368 of file CGLoopInfo.h.

◆ setSYCLIntelFPGAVariantCount()

void clang::CodeGen::LoopInfoStack::setSYCLIntelFPGAVariantCount ( const char *  Var,
unsigned int  Count 
)
inline

Set value of variant and loop count for the next loop pushed.

Definition at line 401 of file CGLoopInfo.h.

◆ setSYCLLoopCoalesceEnable()

void clang::CodeGen::LoopInfoStack::setSYCLLoopCoalesceEnable ( )
inline

Set flag of loop_coalesce for the next loop pushed.

Definition at line 376 of file CGLoopInfo.h.

◆ setSYCLLoopCoalesceNLevels()

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

Set value of coalesced levels for the next loop pushed.

Definition at line 381 of file CGLoopInfo.h.

◆ setSYCLLoopPipeliningDisable()

void clang::CodeGen::LoopInfoStack::setSYCLLoopPipeliningDisable ( )
inline

Set flag of disable_loop_pipelining for the next loop pushed.

Definition at line 386 of file CGLoopInfo.h.

◆ setSYCLLoopPipeliningEnable()

void clang::CodeGen::LoopInfoStack::setSYCLLoopPipeliningEnable ( )
inline

Set flag of enable_loop_pipelining for the next loop pushed.

Definition at line 434 of file CGLoopInfo.h.

◆ setSYCLMaxConcurrencyNThreads()

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

Set value of max_concurrency for the next loop pushed.

Definition at line 371 of file CGLoopInfo.h.

◆ setSYCLMaxInterleavingNInvocations()

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

Set value of max interleaved invocations for the next loop pushed.

Definition at line 391 of file CGLoopInfo.h.

◆ setSYCLMaxReinvocationDelayNCycles()

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

Set value of max reinvocation delay for the next loop pushed.

Definition at line 429 of file CGLoopInfo.h.

◆ setSYCLNofusionEnable()

void clang::CodeGen::LoopInfoStack::setSYCLNofusionEnable ( )
inline

Set flag of nofusion for the next loop pushed.

Definition at line 420 of file CGLoopInfo.h.

◆ setSYCLSpeculatedIterationsNIterations()

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

Set value of speculated iterations for the next loop pushed.

Definition at line 396 of file CGLoopInfo.h.

◆ setUnrollAndJamCount()

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

Set the unroll count for the next loop pushed.

Definition at line 409 of file CGLoopInfo.h.

◆ setUnrollAndJamState()

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

Set the next pushed loop unroll_and_jam state.

Definition at line 347 of file CGLoopInfo.h.

References State.

◆ setUnrollCount()

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

Set the unroll count for the next loop pushed.

Definition at line 406 of file CGLoopInfo.h.

◆ setUnrollState()

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

Set the next pushed loop unroll state.

Definition at line 337 of file CGLoopInfo.h.

References State.

◆ setVectorizeEnable()

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

Set the next pushed loop 'vectorize.enable'.

Definition at line 325 of file CGLoopInfo.h.

◆ setVectorizePredicateState()

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

Set the next pushed vectorize predicate state.

Definition at line 342 of file CGLoopInfo.h.

References State.

◆ setVectorizeScalable()

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

Definition at line 354 of file CGLoopInfo.h.

References State.

◆ setVectorizeWidth()

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

Set the vectorize width for the next loop pushed.

Definition at line 352 of file CGLoopInfo.h.

Referenced by emitSimdlenSafelenClause().


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