#include "AMDGPUMCExpr.h"
#include "GCNSubtarget.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
usingnamespacellvm;
usingnamespacellvm::AMDGPU;
AMDGPUMCExpr::AMDGPUMCExpr(VariantKind Kind, ArrayRef<const MCExpr *> Args,
MCContext &Ctx)
: … { … }
AMDGPUMCExpr::~AMDGPUMCExpr() { … }
const AMDGPUMCExpr *AMDGPUMCExpr::create(VariantKind Kind,
ArrayRef<const MCExpr *> Args,
MCContext &Ctx) { … }
const MCExpr *AMDGPUMCExpr::getSubExpr(size_t Index) const { … }
void AMDGPUMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const { … }
static int64_t op(AMDGPUMCExpr::VariantKind Kind, int64_t Arg1, int64_t Arg2) { … }
bool AMDGPUMCExpr::evaluateExtraSGPRs(MCValue &Res, const MCAssembler *Asm,
const MCFixup *Fixup) const { … }
bool AMDGPUMCExpr::evaluateTotalNumVGPR(MCValue &Res, const MCAssembler *Asm,
const MCFixup *Fixup) const { … }
bool AMDGPUMCExpr::evaluateAlignTo(MCValue &Res, const MCAssembler *Asm,
const MCFixup *Fixup) const { … }
bool AMDGPUMCExpr::evaluateOccupancy(MCValue &Res, const MCAssembler *Asm,
const MCFixup *Fixup) const { … }
bool AMDGPUMCExpr::evaluateAsRelocatableImpl(MCValue &Res,
const MCAssembler *Asm,
const MCFixup *Fixup) const { … }
void AMDGPUMCExpr::visitUsedExpr(MCStreamer &Streamer) const { … }
MCFragment *AMDGPUMCExpr::findAssociatedFragment() const { … }
const AMDGPUMCExpr *AMDGPUMCExpr::createExtraSGPRs(const MCExpr *VCCUsed,
const MCExpr *FlatScrUsed,
bool XNACKUsed,
MCContext &Ctx) { … }
const AMDGPUMCExpr *AMDGPUMCExpr::createTotalNumVGPR(const MCExpr *NumAGPR,
const MCExpr *NumVGPR,
MCContext &Ctx) { … }
const AMDGPUMCExpr *AMDGPUMCExpr::createOccupancy(unsigned InitOcc,
const MCExpr *NumSGPRs,
const MCExpr *NumVGPRs,
const GCNSubtarget &STM,
MCContext &Ctx) { … }
static KnownBits fromOptionalToKnownBits(std::optional<bool> CompareResult) { … }
KnownBitsMap;
static void knownBitsMapHelper(const MCExpr *Expr, KnownBitsMap &KBM,
unsigned Depth = 0);
static void binaryOpKnownBitsMapHelper(const MCExpr *Expr, KnownBitsMap &KBM,
unsigned Depth) { … }
static void unaryOpKnownBitsMapHelper(const MCExpr *Expr, KnownBitsMap &KBM,
unsigned Depth) { … }
static void targetOpKnownBitsMapHelper(const MCExpr *Expr, KnownBitsMap &KBM,
unsigned Depth) { … }
static void knownBitsMapHelper(const MCExpr *Expr, KnownBitsMap &KBM,
unsigned Depth) { … }
static const MCExpr *tryFoldHelper(const MCExpr *Expr, KnownBitsMap &KBM,
MCContext &Ctx) { … }
const MCExpr *llvm::AMDGPU::foldAMDGPUMCExpr(const MCExpr *Expr,
MCContext &Ctx) { … }
void llvm::AMDGPU::printAMDGPUMCExpr(const MCExpr *Expr, raw_ostream &OS,
const MCAsmInfo *MAI) { … }