LLVM 19.0.0git
|
AMDGPU target specific MCExpr operations. More...
#include "Target/AMDGPU/MCTargetDesc/AMDGPUMCExpr.h"
Public Types | |
enum | VariantKind { AGVK_None , AGVK_Or , AGVK_Max , AGVK_ExtraSGPRs , AGVK_TotalNumVGPRs , AGVK_AlignTo , AGVK_Occupancy } |
![]() | |
enum | ExprKind : uint8_t { Binary , Constant , SymbolRef , Unary , Target } |
Public Member Functions | |
VariantKind | getKind () const |
const MCExpr * | getSubExpr (size_t Index) const |
void | printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const override |
bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override |
void | visitUsedExpr (MCStreamer &Streamer) const override |
MCFragment * | findAssociatedFragment () const override |
void | fixELFSymbolsInTLSFixups (MCAssembler &) const override |
![]() | |
virtual void | printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const =0 |
virtual bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const =0 |
virtual bool | isEqualTo (const MCExpr *x) const |
virtual bool | inlineAssignedExpr () const |
virtual void | visitUsedExpr (MCStreamer &Streamer) const =0 |
virtual MCFragment * | findAssociatedFragment () const =0 |
virtual void | fixELFSymbolsInTLSFixups (MCAssembler &) const =0 |
![]() | |
MCExpr (const MCExpr &)=delete | |
MCExpr & | operator= (const MCExpr &)=delete |
ExprKind | getKind () const |
SMLoc | getLoc () const |
void | print (raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const |
void | dump () const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm, const SectionAddrMap &Addrs) const |
Try to evaluate the expression to an absolute value. | |
bool | evaluateAsAbsolute (int64_t &Res) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAsmLayout &Layout) const |
bool | evaluateKnownAbsolute (int64_t &Res, const MCAsmLayout &Layout) const |
bool | evaluateAsRelocatable (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const |
Try to evaluate the expression to a relocatable value, i.e. | |
bool | evaluateAsValue (MCValue &Res, const MCAssembler &Asm) const |
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables. | |
MCFragment * | findAssociatedFragment () const |
Find the "associated section" for this expression, which is currently defined as the absolute section for constants, or otherwise the section associated with the first defined symbol in the expression. | |
Additional Inherited Members | |
![]() | |
MCTargetExpr () | |
virtual | ~MCTargetExpr ()=default |
![]() | |
MCExpr (ExprKind Kind, SMLoc Loc, unsigned SubclassData=0) | |
bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const |
unsigned | getSubclassData () const |
AMDGPU target specific MCExpr operations.
Takes in a minimum of 1 argument to be used with an operation. The supported operations are:
Definition at line 30 of file AMDGPUMCExpr.h.
Enumerator | |
---|---|
AGVK_None | |
AGVK_Or | |
AGVK_Max | |
AGVK_ExtraSGPRs | |
AGVK_TotalNumVGPRs | |
AGVK_AlignTo | |
AGVK_Occupancy |
Definition at line 32 of file AMDGPUMCExpr.h.
Definition at line 103 of file AMDGPUMCExpr.h.
References E, and llvm::MCExpr::Target.
|
static |
Definition at line 43 of file AMDGPUMCExpr.cpp.
Referenced by createAlignTo(), createExtraSGPRs(), createMax(), createOccupancy(), createOr(), and createTotalNumVGPR().
|
inlinestatic |
Definition at line 83 of file AMDGPUMCExpr.h.
References AGVK_AlignTo, and create().
|
static |
Allow delayed MCExpr resolve of ExtraSGPRs (in case VCCUsed or FlatScrUsed are unresolvable but needed for further MCExprs).
Derived from implementation of IsaInfo::getNumExtraSGPRs in AMDGPUBaseInfo.cpp.
Definition at line 270 of file AMDGPUMCExpr.cpp.
References AGVK_ExtraSGPRs, llvm::MCConstantExpr::create(), and create().
Referenced by llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd().
|
inlinestatic |
Definition at line 69 of file AMDGPUMCExpr.h.
|
static |
Mimics GCNSubtarget::computeOccupancy for MCExpr.
Remove dependency on GCNSubtarget and depend only only the necessary values for said occupancy computation. Should match computeOccupancy implementation without passing STM
on.
Definition at line 291 of file AMDGPUMCExpr.cpp.
References AGVK_Occupancy, llvm::MCConstantExpr::create(), create(), llvm::GCNSubtarget::getGeneration(), llvm::AMDGPU::IsaInfo::getMaxWavesPerEU(), llvm::AMDGPU::IsaInfo::getTotalNumVGPRs(), and llvm::AMDGPU::IsaInfo::getVGPRAllocGranule().
|
inlinestatic |
Definition at line 64 of file AMDGPUMCExpr.h.
|
static |
Definition at line 280 of file AMDGPUMCExpr.cpp.
References AGVK_TotalNumVGPRs, and create().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 220 of file AMDGPUMCExpr.cpp.
References AGVK_AlignTo, AGVK_ExtraSGPRs, AGVK_Occupancy, AGVK_TotalNumVGPRs, llvm::MCExpr::evaluateAsRelocatable(), Fixup, llvm::MCValue::get(), llvm::MCValue::getConstant(), llvm::MCValue::isAbsolute(), op, and llvm::Total.
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 258 of file AMDGPUMCExpr.cpp.
References llvm::MCExpr::findAssociatedFragment().
|
inlineoverridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 101 of file AMDGPUMCExpr.h.
|
inline |
Definition at line 93 of file AMDGPUMCExpr.h.
Definition at line 49 of file AMDGPUMCExpr.cpp.
References assert().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 54 of file AMDGPUMCExpr.cpp.
References AGVK_AlignTo, AGVK_ExtraSGPRs, AGVK_Max, AGVK_Occupancy, AGVK_Or, AGVK_TotalNumVGPRs, llvm_unreachable, and OS.
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 253 of file AMDGPUMCExpr.cpp.
References llvm::MCStreamer::visitUsedExpr().