class LoopInfo

Declaration

class LoopInfo { /* full declaration omitted */ };

Description

Information used when generating a structured loop.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:87

Member Variables

private llvm::TempMDTuple TempLoopID
Loop ID metadata.
private llvm::BasicBlock* Header
Header block of this loop.
private clang::CodeGen::LoopAttributes Attrs
The attributes for this loop.
private llvm::MDNode* AccGroup = nullptr
The access group for memory accesses parallel to this loop.
private llvm::DebugLoc StartLoc
Start location of this loop.
private llvm::DebugLoc EndLoc
End location of this loop.
private clang::CodeGen::LoopInfo* Parent
The next outer loop, or nullptr if this is the outermost loop.
private llvm::MDNode* UnrollAndJamInnerFollowup = nullptr
If this loop has unroll-and-jam metadata, this can be set by the inner loop's LoopInfo to set the llvm.loop.unroll_and_jam.followup_inner metadata.

Method Overview

  • public LoopInfo(llvm::BasicBlock * Header, const clang::CodeGen::LoopAttributes & Attrs, const llvm::DebugLoc & StartLoc, const llvm::DebugLoc & EndLoc, clang::CodeGen::LoopInfo * Parent)
  • private llvm::MDNode * createFullUnrollMetadata(const clang::CodeGen::LoopAttributes & Attrs, llvm::ArrayRef<llvm::Metadata *> LoopProperties, bool & HasUserTransforms)
  • private llvm::MDNode * createLoopDistributeMetadata(const clang::CodeGen::LoopAttributes & Attrs, llvm::ArrayRef<llvm::Metadata *> LoopProperties, bool & HasUserTransforms)
  • private llvm::MDNode * createLoopPropertiesMetadata(llvm::ArrayRef<llvm::Metadata *> LoopProperties)
  • private llvm::MDNode * createLoopVectorizeMetadata(const clang::CodeGen::LoopAttributes & Attrs, llvm::ArrayRef<llvm::Metadata *> LoopProperties, bool & HasUserTransforms)
  • private llvm::MDNode * createMetadata(const clang::CodeGen::LoopAttributes & Attrs, llvm::ArrayRef<llvm::Metadata *> LoopProperties, bool & HasUserTransforms)
  • private llvm::MDNode * createPartialUnrollMetadata(const clang::CodeGen::LoopAttributes & Attrs, llvm::ArrayRef<llvm::Metadata *> LoopProperties, bool & HasUserTransforms)
  • private llvm::MDNode * createPipeliningMetadata(const clang::CodeGen::LoopAttributes & Attrs, llvm::ArrayRef<llvm::Metadata *> LoopProperties, bool & HasUserTransforms)
  • private llvm::MDNode * createUnrollAndJamMetadata(const clang::CodeGen::LoopAttributes & Attrs, llvm::ArrayRef<llvm::Metadata *> LoopProperties, bool & HasUserTransforms)
  • public void finish()
  • public llvm::MDNode * getAccessGroup() const
  • public const clang::CodeGen::LoopAttributes & getAttributes() const
  • public llvm::BasicBlock * getHeader() const
  • public llvm::MDNode * getLoopID() const

Methods

LoopInfo(
    llvm::BasicBlock* Header,
    const clang::CodeGen::LoopAttributes& Attrs,
    const llvm::DebugLoc& StartLoc,
    const llvm::DebugLoc& EndLoc,
    clang::CodeGen::LoopInfo* Parent)

Description

Construct a new LoopInfo for the loop with entry Header.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:90

Parameters

llvm::BasicBlock* Header
const clang::CodeGen::LoopAttributes& Attrs
const llvm::DebugLoc& StartLoc
const llvm::DebugLoc& EndLoc
clang::CodeGen::LoopInfo* Parent

llvm::MDNode* createFullUnrollMetadata(
    const clang::CodeGen::LoopAttributes& Attrs,
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties,
    bool& HasUserTransforms)

Declared at: clang/lib/CodeGen/CGLoopInfo.h:172

Parameters

const clang::CodeGen::LoopAttributes& Attrs
llvm::ArrayRef<llvm::Metadata*> LoopProperties
bool& HasUserTransforms

llvm::MDNode* createLoopDistributeMetadata(
    const clang::CodeGen::LoopAttributes& Attrs,
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties,
    bool& HasUserTransforms)

Declared at: clang/lib/CodeGen/CGLoopInfo.h:168

Parameters

const clang::CodeGen::LoopAttributes& Attrs
llvm::ArrayRef<llvm::Metadata*> LoopProperties
bool& HasUserTransforms

llvm::MDNode* createLoopPropertiesMetadata(
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties)

Description

Create a LoopID without any transformations.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:132

Parameters

llvm::ArrayRef<llvm::Metadata*> LoopProperties

llvm::MDNode* createLoopVectorizeMetadata(
    const clang::CodeGen::LoopAttributes& Attrs,
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties,
    bool& HasUserTransforms)

Declared at: clang/lib/CodeGen/CGLoopInfo.h:164

Parameters

const clang::CodeGen::LoopAttributes& Attrs
llvm::ArrayRef<llvm::Metadata*> LoopProperties
bool& HasUserTransforms

llvm::MDNode* createMetadata(
    const clang::CodeGen::LoopAttributes& Attrs,
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties,
    bool& HasUserTransforms)

Description

Create a LoopID for this loop, including transformation-unspecific metadata such as debug location.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:189

Parameters

const clang::CodeGen::LoopAttributes& Attrs
This loop's attributes and transformations.
llvm::ArrayRef<llvm::Metadata*> LoopProperties
Additional non-transformation properties to add to the LoopID, such as transformation-specific metadata that are not covered by @p Attrs.
bool& HasUserTransforms
[out] Set to true if the returned MDNode encodes at least one transformation.

Returns

A LoopID (metadata node) that can be used for the llvm.loop annotation.

llvm::MDNode* createPartialUnrollMetadata(
    const clang::CodeGen::LoopAttributes& Attrs,
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties,
    bool& HasUserTransforms)

Declared at: clang/lib/CodeGen/CGLoopInfo.h:156

Parameters

const clang::CodeGen::LoopAttributes& Attrs
llvm::ArrayRef<llvm::Metadata*> LoopProperties
bool& HasUserTransforms

llvm::MDNode* createPipeliningMetadata(
    const clang::CodeGen::LoopAttributes& Attrs,
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties,
    bool& HasUserTransforms)

Description

Create a LoopID for transformations. The methods call each other in case multiple transformations are applied to a loop. The transformation first to be applied will use LoopID of the next transformation in its followup attribute.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:152

Parameters

const clang::CodeGen::LoopAttributes& Attrs
The loop's transformations.
llvm::ArrayRef<llvm::Metadata*> LoopProperties
Non-transformation properties such as debug location, parallel accesses and disabled transformations. These are added to the returned LoopID.
bool& HasUserTransforms
[out] Set to true if the returned MDNode encodes at least one transformation.

Returns

A LoopID (metadata node) that can be used for the llvm.loop annotation or followup-attribute. @ {

llvm::MDNode* createUnrollAndJamMetadata(
    const clang::CodeGen::LoopAttributes& Attrs,
    llvm::ArrayRef<llvm::Metadata*>
        LoopProperties,
    bool& HasUserTransforms)

Declared at: clang/lib/CodeGen/CGLoopInfo.h:160

Parameters

const clang::CodeGen::LoopAttributes& Attrs
llvm::ArrayRef<llvm::Metadata*> LoopProperties
bool& HasUserTransforms

void finish()

Description

Create the loop's metadata. Must be called after its nested loops have been processed.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:108

llvm::MDNode* getAccessGroup() const

Description

Return this loop's access group or nullptr if it does not have one.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:104

const clang::CodeGen::LoopAttributes&
getAttributes() const

Description

Get the set of attributes active for this loop.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:101

llvm::BasicBlock* getHeader() const

Description

Get the header block of this loop.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:98

llvm::MDNode* getLoopID() const

Description

Get the loop id metadata for this loop.

Declared at: clang/lib/CodeGen/CGLoopInfo.h:95