#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/ADT/StableHashing.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/Loads.h"
#include "llvm/CodeGen/MIRFormatter.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValueManager.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/Target/TargetIntrinsicInfo.h"
#include "llvm/Target/TargetMachine.h"
#include <optional>
usingnamespacellvm;
static cl::opt<int>
PrintRegMaskNumRegs("print-regmask-num-regs",
cl::desc("Number of registers to limit to when "
"printing regmask operands in IR dumps. "
"unlimited = -1"),
cl::init(32), cl::Hidden);
static const MachineFunction *getMFIfAvailable(const MachineOperand &MO) { … }
static MachineFunction *getMFIfAvailable(MachineOperand &MO) { … }
unsigned MachineOperand::getOperandNo() const { … }
void MachineOperand::setReg(Register Reg) { … }
void MachineOperand::substVirtReg(Register Reg, unsigned SubIdx,
const TargetRegisterInfo &TRI) { … }
void MachineOperand::substPhysReg(MCRegister Reg, const TargetRegisterInfo &TRI) { … }
void MachineOperand::setIsDef(bool Val) { … }
bool MachineOperand::isRenamable() const { … }
void MachineOperand::setIsRenamable(bool Val) { … }
void MachineOperand::removeRegFromUses() { … }
void MachineOperand::ChangeToImmediate(int64_t ImmVal, unsigned TargetFlags) { … }
void MachineOperand::ChangeToFPImmediate(const ConstantFP *FPImm,
unsigned TargetFlags) { … }
void MachineOperand::ChangeToES(const char *SymName,
unsigned TargetFlags) { … }
void MachineOperand::ChangeToGA(const GlobalValue *GV, int64_t Offset,
unsigned TargetFlags) { … }
void MachineOperand::ChangeToBA(const BlockAddress *BA, int64_t Offset,
unsigned TargetFlags) { … }
void MachineOperand::ChangeToMCSymbol(MCSymbol *Sym, unsigned TargetFlags) { … }
void MachineOperand::ChangeToFrameIndex(int Idx, unsigned TargetFlags) { … }
void MachineOperand::ChangeToTargetIndex(unsigned Idx, int64_t Offset,
unsigned TargetFlags) { … }
void MachineOperand::ChangeToDbgInstrRef(unsigned InstrIdx, unsigned OpIdx,
unsigned TargetFlags) { … }
void MachineOperand::ChangeToRegister(Register Reg, bool isDef, bool isImp,
bool isKill, bool isDead, bool isUndef,
bool isDebug) { … }
bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { … }
hash_code llvm::hash_value(const MachineOperand &MO) { … }
static void tryToGetTargetInfo(const MachineOperand &MO,
const TargetRegisterInfo *&TRI,
const TargetIntrinsicInfo *&IntrinsicInfo) { … }
static const char *getTargetIndexName(const MachineFunction &MF, int Index) { … }
const char *MachineOperand::getTargetIndexName() const { … }
static const char *getTargetFlagName(const TargetInstrInfo *TII, unsigned TF) { … }
static void printCFIRegister(unsigned DwarfReg, raw_ostream &OS,
const TargetRegisterInfo *TRI) { … }
static void printIRBlockReference(raw_ostream &OS, const BasicBlock &BB,
ModuleSlotTracker &MST) { … }
static void printSyncScope(raw_ostream &OS, const LLVMContext &Context,
SyncScope::ID SSID,
SmallVectorImpl<StringRef> &SSNs) { … }
static const char *getTargetMMOFlagName(const TargetInstrInfo &TII,
unsigned TMMOFlag) { … }
static void printFrameIndex(raw_ostream& OS, int FrameIndex, bool IsFixed,
const MachineFrameInfo *MFI) { … }
void MachineOperand::printSubRegIdx(raw_ostream &OS, uint64_t Index,
const TargetRegisterInfo *TRI) { … }
void MachineOperand::printTargetFlags(raw_ostream &OS,
const MachineOperand &Op) { … }
void MachineOperand::printSymbol(raw_ostream &OS, MCSymbol &Sym) { … }
void MachineOperand::printStackObjectReference(raw_ostream &OS,
unsigned FrameIndex,
bool IsFixed, StringRef Name) { … }
void MachineOperand::printOperandOffset(raw_ostream &OS, int64_t Offset) { … }
void MachineOperand::printIRSlotNumber(raw_ostream &OS, int Slot) { … }
static void printCFI(raw_ostream &OS, const MCCFIInstruction &CFI,
const TargetRegisterInfo *TRI) { … }
void MachineOperand::print(raw_ostream &OS, const TargetRegisterInfo *TRI,
const TargetIntrinsicInfo *IntrinsicInfo) const { … }
void MachineOperand::print(raw_ostream &OS, LLT TypeToPrint,
const TargetRegisterInfo *TRI,
const TargetIntrinsicInfo *IntrinsicInfo) const { … }
void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
LLT TypeToPrint, std::optional<unsigned> OpIdx,
bool PrintDef, bool IsStandalone,
bool ShouldPrintRegisterTies,
unsigned TiedOperandIdx,
const TargetRegisterInfo *TRI,
const TargetIntrinsicInfo *IntrinsicInfo) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void MachineOperand::dump() const { dbgs() << *this << '\n'; }
#endif
unsigned MachinePointerInfo::getAddrSpace() const { … }
bool MachinePointerInfo::isDereferenceable(unsigned Size, LLVMContext &C,
const DataLayout &DL) const { … }
MachinePointerInfo MachinePointerInfo::getConstantPool(MachineFunction &MF) { … }
MachinePointerInfo MachinePointerInfo::getFixedStack(MachineFunction &MF,
int FI, int64_t Offset) { … }
MachinePointerInfo MachinePointerInfo::getJumpTable(MachineFunction &MF) { … }
MachinePointerInfo MachinePointerInfo::getGOT(MachineFunction &MF) { … }
MachinePointerInfo MachinePointerInfo::getStack(MachineFunction &MF,
int64_t Offset, uint8_t ID) { … }
MachinePointerInfo MachinePointerInfo::getUnknownStack(MachineFunction &MF) { … }
MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, Flags f,
LLT type, Align a, const AAMDNodes &AAInfo,
const MDNode *Ranges, SyncScope::ID SSID,
AtomicOrdering Ordering,
AtomicOrdering FailureOrdering)
: … { … }
MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, Flags F,
LocationSize TS, Align BaseAlignment,
const AAMDNodes &AAInfo,
const MDNode *Ranges, SyncScope::ID SSID,
AtomicOrdering Ordering,
AtomicOrdering FailureOrdering)
: … { … }
void MachineMemOperand::refineAlignment(const MachineMemOperand *MMO) { … }
Align MachineMemOperand::getAlign() const { … }
void MachineMemOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
SmallVectorImpl<StringRef> &SSNs,
const LLVMContext &Context,
const MachineFrameInfo *MFI,
const TargetInstrInfo *TII) const { … }