|
LLVM 23.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 , AGVK_InstPrefSize , AGVK_Lit , AGVK_Lit64 , AGVK_Min } |
| enum | Specifier { S_None , S_GOTPCREL , S_GOTPCREL32_LO , S_GOTPCREL32_HI , S_REL32_LO , S_REL32_HI , S_REL64 , S_ABS32_LO , S_ABS32_HI , S_ABS64 } |
| Public Types inherited from llvm::MCExpr | |
| enum | ExprKind : uint8_t { Binary , Constant , SymbolRef , Unary , Specifier , Target } |
Public Member Functions | |
| ArrayRef< const MCExpr * > | getArgs () const |
| VariantKind | getKind () const |
| MCContext & | getCtx () 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 override |
| void | visitUsedExpr (MCStreamer &Streamer) const override |
| MCFragment * | findAssociatedFragment () const override |
| Public Member Functions inherited from llvm::MCTargetExpr | |
| virtual bool | isEqualTo (const MCExpr *x) const |
| virtual bool | inlineAssignedExpr () const |
| Public Member Functions inherited from llvm::MCExpr | |
| MCExpr (const MCExpr &)=delete | |
| MCExpr & | operator= (const MCExpr &)=delete |
| ExprKind | getKind () const |
| SMLoc | getLoc () const |
| LLVM_ABI void | dump () const |
| LLVM_ABI bool | evaluateAsAbsolute (int64_t &Res) const |
| Try to evaluate the expression to an absolute value. | |
| LLVM_ABI bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const |
| LLVM_ABI bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const |
| LLVM_ABI bool | evaluateKnownAbsolute (int64_t &Res, const MCAssembler &Asm) const |
| Aggressive variant of evaluateAsRelocatable when relocations are unavailable (e.g. | |
| LLVM_ABI bool | evaluateAsRelocatable (MCValue &Res, const MCAssembler *Asm) const |
| Try to evaluate the expression to a relocatable value, i.e. | |
| LLVM_ABI 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. | |
| LLVM_ABI 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. | |
Static Public Member Functions | |
| static const AMDGPUMCExpr * | create (VariantKind Kind, ArrayRef< const MCExpr * > Args, MCContext &Ctx) |
| static unsigned | getNumExpectedArgs (VariantKind Kind) |
| static const AMDGPUMCExpr * | createOr (ArrayRef< const MCExpr * > Args, MCContext &Ctx) |
| static const AMDGPUMCExpr * | createMax (ArrayRef< const MCExpr * > Args, MCContext &Ctx) |
| static const AMDGPUMCExpr * | createMin (ArrayRef< const MCExpr * > Args, MCContext &Ctx) |
| static const AMDGPUMCExpr * | createExtraSGPRs (const MCExpr *VCCUsed, const MCExpr *FlatScrUsed, bool XNACKUsed, MCContext &Ctx) |
| Allow delayed MCExpr resolve of ExtraSGPRs (in case VCCUsed or FlatScrUsed are unresolvable but needed for further MCExprs). | |
| static const AMDGPUMCExpr * | createTotalNumVGPR (const MCExpr *NumAGPR, const MCExpr *NumVGPR, MCContext &Ctx) |
| static const AMDGPUMCExpr * | createAlignTo (const MCExpr *Value, const MCExpr *Align, MCContext &Ctx) |
| static const AMDGPUMCExpr * | createInstPrefSize (const MCExpr *CodeSizeBytes, MCContext &Ctx) |
| Create an expression for instruction prefetch size computation: min(divideCeil(CodeSizeBytes, CacheLineSize), (1 << FieldWidth) - 1) FieldWidth and CacheLineSize are derived from the subtarget. | |
| static const AMDGPUMCExpr * | createLit (LitModifier Lit, int64_t Value, MCContext &Ctx) |
| static bool | classof (const MCExpr *E) |
| static bool | isSymbolUsedInExpression (const MCSymbol *Sym, const MCExpr *E) |
| Static Public Member Functions inherited from llvm::MCTargetExpr | |
| static bool | classof (const MCExpr *E) |
| Static Public Member Functions inherited from llvm::MCExpr | |
| static LLVM_ABI bool | evaluateSymbolicAdd (const MCAssembler *, bool, const MCValue &, const MCValue &, MCValue &) |
Additional Inherited Members | |
| Protected Types inherited from llvm::MCExpr | |
| using | Spec = uint16_t |
| 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) | |
| LLVM_ABI bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, 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 33 of file AMDGPUMCExpr.h.
| Enumerator | |
|---|---|
| S_None | |
| S_GOTPCREL | |
| S_GOTPCREL32_LO | |
| S_GOTPCREL32_HI | |
| S_REL32_LO | |
| S_REL32_HI | |
| S_REL64 | |
| S_ABS32_LO | |
| S_ABS32_HI | |
| S_ABS64 | |
Definition at line 50 of file AMDGPUMCExpr.h.
| Enumerator | |
|---|---|
| AGVK_None | |
| AGVK_Or | |
| AGVK_Max | |
| AGVK_ExtraSGPRs | |
| AGVK_TotalNumVGPRs | |
| AGVK_AlignTo | |
| AGVK_Occupancy | |
| AGVK_InstPrefSize | |
| AGVK_Lit | |
| AGVK_Lit64 | |
| AGVK_Min | |
Definition at line 35 of file AMDGPUMCExpr.h.
Definition at line 133 of file AMDGPUMCExpr.h.
References E(), and llvm::MCExpr::Target.
|
static |
Definition at line 50 of file AMDGPUMCExpr.cpp.
Referenced by createAlignTo(), createExtraSGPRs(), createInstPrefSize(), createLit(), createMax(), createMin(), createOccupancy(), createOr(), createTotalNumVGPR(), and tryFoldHelper().
|
inlinestatic |
Definition at line 109 of file AMDGPUMCExpr.h.
References AGVK_AlignTo, and create().
Referenced by computeAccumOffset().
|
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 331 of file AMDGPUMCExpr.cpp.
References AGVK_ExtraSGPRs, create(), and llvm::MCConstantExpr::create().
Referenced by llvm::MCResourceInfo::createTotalNumSGPRs(), and llvm::AMDGPUAsmPrinter::endFunction().
|
static |
Create an expression for instruction prefetch size computation: min(divideCeil(CodeSizeBytes, CacheLineSize), (1 << FieldWidth) - 1) FieldWidth and CacheLineSize are derived from the subtarget.
Definition at line 348 of file AMDGPUMCExpr.cpp.
References AGVK_InstPrefSize, and create().
Referenced by llvm::AMDGPUAsmPrinter::endFunction().
|
static |
Definition at line 352 of file AMDGPUMCExpr.cpp.
References AGVK_Lit, AGVK_Lit64, assert(), create(), llvm::MCConstantExpr::create(), llvm::Lit, and llvm::Lit64.
Referenced by llvm::AMDGPUDisassembler::decodeLiteral64Constant(), llvm::AMDGPUDisassembler::decodeLiteralConstant(), and llvm::AMDGPUDisassembler::decodeMandatoryLiteral64Constant().
|
inlinestatic |
Definition at line 91 of file AMDGPUMCExpr.h.
References AGVK_Max, and create().
Referenced by computeAccumOffset(), and llvm::MCResourceInfo::gatherResourceInfo().
|
inlinestatic |
Definition at line 95 of file AMDGPUMCExpr.h.
|
inlinestatic |
Definition at line 86 of file AMDGPUMCExpr.h.
|
static |
Definition at line 341 of file AMDGPUMCExpr.cpp.
References AGVK_TotalNumVGPRs, and create().
Referenced by llvm::MCResourceInfo::createTotalNumVGPRs().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 279 of file AMDGPUMCExpr.cpp.
References AGVK_AlignTo, AGVK_ExtraSGPRs, AGVK_InstPrefSize, AGVK_Lit, AGVK_Lit64, AGVK_Occupancy, AGVK_TotalNumVGPRs, llvm::MCValue::get(), llvm::MCValue::getConstant(), llvm::MCValue::isAbsolute(), op, and llvm::Total.
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 319 of file AMDGPUMCExpr.cpp.
Definition at line 122 of file AMDGPUMCExpr.h.
Referenced by targetOpKnownBitsMapHelper(), and tryFoldHelper().
|
inline |
Definition at line 124 of file AMDGPUMCExpr.h.
Referenced by targetOpKnownBitsMapHelper().
|
inline |
Definition at line 123 of file AMDGPUMCExpr.h.
Referenced by targetOpKnownBitsMapHelper(), and tryFoldHelper().
|
static |
Kind, or 0 for the variadic kinds (or/max/min). Used at parse time and by the create() assert. Definition at line 56 of file AMDGPUMCExpr.cpp.
References AGVK_AlignTo, AGVK_ExtraSGPRs, AGVK_InstPrefSize, AGVK_Lit, AGVK_Lit64, AGVK_Max, AGVK_Min, AGVK_None, AGVK_Occupancy, AGVK_Or, AGVK_TotalNumVGPRs, and llvm_unreachable.
Definition at line 80 of file AMDGPUMCExpr.cpp.
References assert().
Referenced by isSymbolUsedInExpression(), and targetOpKnownBitsMapHelper().
Definition at line 248 of file AMDGPUMCExpr.cpp.
References llvm::MCExpr::Binary, llvm::MCExpr::Constant, llvm::MCBinaryExpr::getLHS(), llvm::MCBinaryExpr::getRHS(), getSubExpr(), llvm::MCSymbol::getVariableValue(), isSymbolUsedInExpression(), llvm::MCSymbol::isVariable(), llvm_unreachable, llvm::MCExpr::Specifier, llvm::MCExpr::SymbolRef, llvm::MCExpr::Target, and llvm::MCExpr::Unary.
Referenced by llvm::MCResourceInfo::gatherResourceInfo(), and isSymbolUsedInExpression().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 85 of file AMDGPUMCExpr.cpp.
References AGVK_AlignTo, AGVK_ExtraSGPRs, AGVK_InstPrefSize, AGVK_Lit, AGVK_Lit64, AGVK_Max, AGVK_Min, AGVK_Occupancy, AGVK_Or, AGVK_TotalNumVGPRs, llvm_unreachable, and llvm::MCAsmInfo::printExpr().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 314 of file AMDGPUMCExpr.cpp.
References llvm::MCStreamer::visitUsedExpr().