LLVM 23.0.0git
llvm::GlobalValueSummary::GVFlags Struct Reference

Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield. More...

#include "llvm/IR/ModuleSummaryIndex.h"

Public Member Functions

 GVFlags (GlobalValue::LinkageTypes Linkage, GlobalValue::VisibilityTypes Visibility, bool NotEligibleToImport, bool Live, bool IsLocal, bool CanAutoHide, ImportKind ImportType, bool NoRenameOnPromotion)
 Convenience Constructors.

Public Attributes

unsigned Linkage: 4
 The linkage type of the associated global value.
unsigned Visibility: 2
 Indicates the visibility.
unsigned NotEligibleToImport: 1
 Indicate if the global value cannot be imported (e.g.
unsigned Live: 1
 In per-module summary, indicate that the global value must be considered a live root for index-based liveness analysis.
unsigned DSOLocal: 1
 Indicates that the linker resolved the symbol to a definition from within the same linkage unit.
unsigned CanAutoHide: 1
 In the per-module summary, indicates that the global value is linkonce_odr and global unnamed addr (so eligible for auto-hiding via hidden visibility).
unsigned ImportType: 1
 This field is written by the ThinLTO indexing step to postlink combined summary.
unsigned Promoted: 1
 This symbol was promoted.
unsigned NoRenameOnPromotion: 1
 This field is written by the ThinLTO prelink stage to decide whether a particular static global value should be promoted or not.

Detailed Description

Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield.

Definition at line 471 of file ModuleSummaryIndex.h.

Constructor & Destructor Documentation

◆ GVFlags()

llvm::GlobalValueSummary::GVFlags::GVFlags ( GlobalValue::LinkageTypes Linkage,
GlobalValue::VisibilityTypes Visibility,
bool NotEligibleToImport,
bool Live,
bool IsLocal,
bool CanAutoHide,
ImportKind ImportType,
bool NoRenameOnPromotion )
inlineexplicit

Convenience Constructors.

Definition at line 523 of file ModuleSummaryIndex.h.

References CanAutoHide, DSOLocal, ImportType, Linkage, Live, NoRenameOnPromotion, NotEligibleToImport, Promoted, and Visibility.

Member Data Documentation

◆ CanAutoHide

unsigned llvm::GlobalValueSummary::GVFlags::CanAutoHide

In the per-module summary, indicates that the global value is linkonce_odr and global unnamed addr (so eligible for auto-hiding via hidden visibility).

In the combined summary, indicates that the prevailing linkonce_odr copy can be auto-hidden via hidden visibility when it is upgraded to weak_odr in the backend. This is legal when all copies are eligible for auto-hiding (i.e. all copies were linkonce_odr global unnamed addr. If any copy is not (e.g. it was originally weak_odr, we cannot auto-hide the prevailing copy as it means the symbol was externally visible.

Definition at line 508 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ DSOLocal

unsigned llvm::GlobalValueSummary::GVFlags::DSOLocal

Indicates that the linker resolved the symbol to a definition from within the same linkage unit.

Definition at line 497 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ ImportType

unsigned llvm::GlobalValueSummary::GVFlags::ImportType

This field is written by the ThinLTO indexing step to postlink combined summary.

The value is interpreted as 'ImportKind' enum defined above.

Definition at line 512 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ Linkage

unsigned llvm::GlobalValueSummary::GVFlags::Linkage

The linkage type of the associated global value.

One use is to flag values that have local linkage types and need to have module identifier appended before placing into the combined index, to disambiguate from other values with the same name. In the future this will be used to update and optimize linkage types based on global summary-based analysis.

Definition at line 479 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ Live

unsigned llvm::GlobalValueSummary::GVFlags::Live

In per-module summary, indicate that the global value must be considered a live root for index-based liveness analysis.

Used for special LLVM values such as llvm.global_ctors that the linker does not know about.

In combined summary, indicate that the global value is live.

Definition at line 493 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ NoRenameOnPromotion

unsigned llvm::GlobalValueSummary::GVFlags::NoRenameOnPromotion

This field is written by the ThinLTO prelink stage to decide whether a particular static global value should be promoted or not.

Definition at line 520 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ NotEligibleToImport

unsigned llvm::GlobalValueSummary::GVFlags::NotEligibleToImport

Indicate if the global value cannot be imported (e.g.

it cannot be renamed or references something that can't be renamed).

Definition at line 486 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ Promoted

unsigned llvm::GlobalValueSummary::GVFlags::Promoted

This symbol was promoted.

Thinlink stages need to be aware of this transition

Definition at line 516 of file ModuleSummaryIndex.h.

Referenced by GVFlags().

◆ Visibility

unsigned llvm::GlobalValueSummary::GVFlags::Visibility

Indicates the visibility.

Definition at line 482 of file ModuleSummaryIndex.h.

Referenced by GVFlags().


The documentation for this struct was generated from the following file: