LLVM 20.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 } |
Public Types inherited from llvm::MCExpr | |
enum | ExprKind : uint8_t { Binary , Constant , SymbolRef , Unary , Target } |
Public Member Functions | |
ArrayRef< const MCExpr * > | getArgs () const |
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 MCAssembler *Asm, const MCFixup *Fixup) const override |
void | visitUsedExpr (MCStreamer &Streamer) const override |
MCFragment * | findAssociatedFragment () const override |
void | fixELFSymbolsInTLSFixups (MCAssembler &) const override |
Public Member Functions inherited from llvm::MCTargetExpr | |
virtual void | printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const =0 |
virtual bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, 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 |
Public Member Functions inherited from llvm::MCExpr | |
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 | evaluateKnownAbsolute (int64_t &Res, const MCAssembler &Asm) const |
Aggressive variant of evaluateAsRelocatable when relocations are unavailable (e.g. | |
bool | evaluateAsRelocatable (MCValue &Res, const MCAssembler *Asm, 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 | |
Protected Member Functions inherited from llvm::MCTargetExpr | |
MCTargetExpr () | |
virtual | ~MCTargetExpr ()=default |
Protected Member Functions inherited from llvm::MCExpr | |
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 104 of file AMDGPUMCExpr.h.
References E, and llvm::MCExpr::Target.
|
static |
Definition at line 46 of file AMDGPUMCExpr.cpp.
Referenced by createAlignTo(), createExtraSGPRs(), createMax(), createOccupancy(), createOr(), createTotalNumVGPR(), and tryFoldHelper().
|
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 267 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 288 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 277 of file AMDGPUMCExpr.cpp.
References AGVK_TotalNumVGPRs, and create().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 219 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 255 of file AMDGPUMCExpr.cpp.
References llvm::MCExpr::findAssociatedFragment().
|
inlineoverridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 102 of file AMDGPUMCExpr.h.
Definition at line 93 of file AMDGPUMCExpr.h.
Referenced by targetOpKnownBitsMapHelper(), and tryFoldHelper().
|
inline |
Definition at line 94 of file AMDGPUMCExpr.h.
Referenced by targetOpKnownBitsMapHelper(), and tryFoldHelper().
Definition at line 52 of file AMDGPUMCExpr.cpp.
References assert().
Referenced by targetOpKnownBitsMapHelper().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 57 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 250 of file AMDGPUMCExpr.cpp.
References llvm::MCStreamer::visitUsedExpr().