LLVM 20.0.0git
|
MIRFormater - Interface to format MIR operand based on target. More...
#include "llvm/CodeGen/MIRFormatter.h"
Public Types | |
typedef function_ref< bool(StringRef::iterator Loc, const Twine &)> | ErrorCallbackType |
Public Member Functions | |
MIRFormatter ()=default | |
virtual | ~MIRFormatter ()=default |
virtual void | printImm (raw_ostream &OS, const MachineInstr &MI, std::optional< unsigned > OpIdx, int64_t Imm) const |
Implement target specific printing for machine operand immediate value, so that we can have more meaningful mnemonic than a 64-bit integer. | |
virtual bool | parseImmMnemonic (const unsigned OpCode, const unsigned OpIdx, StringRef Src, int64_t &Imm, ErrorCallbackType ErrorCallback) const |
Implement target specific parsing of immediate mnemonics. | |
virtual void | printCustomPseudoSourceValue (raw_ostream &OS, ModuleSlotTracker &MST, const PseudoSourceValue &PSV) const |
Implement target specific printing of target custom pseudo source value. | |
virtual bool | parseCustomPseudoSourceValue (StringRef Src, MachineFunction &MF, PerFunctionMIParsingState &PFS, const PseudoSourceValue *&PSV, ErrorCallbackType ErrorCallback) const |
Implement target specific parsing of target custom pseudo source value. | |
Static Public Member Functions | |
static void | printIRValue (raw_ostream &OS, const Value &V, ModuleSlotTracker &MST) |
Helper functions to print IR value as MIR serialization format which will be useful for target specific printer, e.g. | |
static bool | parseIRValue (StringRef Src, MachineFunction &MF, PerFunctionMIParsingState &PFS, const Value *&V, ErrorCallbackType ErrorCallback) |
Helper functions to parse IR value from MIR serialization format which will be useful for target specific parser, e.g. | |
MIRFormater - Interface to format MIR operand based on target.
Definition at line 32 of file MIRFormatter.h.
typedef function_ref<bool(StringRef::iterator Loc, const Twine &)> llvm::MIRFormatter::ErrorCallbackType |
Definition at line 35 of file MIRFormatter.h.
|
default |
|
virtualdefault |
|
inlinevirtual |
Implement target specific parsing of target custom pseudo source value.
Reimplemented in llvm::AMDGPUMIRFormatter.
Definition at line 66 of file MIRFormatter.h.
References llvm_unreachable.
|
inlinevirtual |
Implement target specific parsing of immediate mnemonics.
The mnemonic is dot separated strings.
Reimplemented in llvm::AMDGPUMIRFormatter.
Definition at line 50 of file MIRFormatter.h.
References llvm_unreachable.
|
static |
Helper functions to parse IR value from MIR serialization format which will be useful for target specific parser, e.g.
for parsing IR value for custom pseudo source value.
Definition at line 3625 of file MIParser.cpp.
References llvm::lexMIToken().
|
inlinevirtual |
Implement target specific printing of target custom pseudo source value.
Default implementation is not necessarily the correct MIR serialization format.
Definition at line 60 of file MIRFormatter.h.
References OS.
Referenced by llvm::MachineMemOperand::print().
|
inlinevirtual |
Implement target specific printing for machine operand immediate value, so that we can have more meaningful mnemonic than a 64-bit integer.
Passing std::nullopt to OpIdx means the index is unknown.
Reimplemented in llvm::AMDGPUMIRFormatter.
Definition at line 43 of file MIRFormatter.h.
References OS.
Referenced by llvm::MachineOperand::print(), and llvm::AMDGPUMIRFormatter::printImm().
|
static |
Helper functions to print IR value as MIR serialization format which will be useful for target specific printer, e.g.
for printing IR value in custom pseudo source value.
Definition at line 980 of file MIRPrinter.cpp.
References llvm::ModuleSlotTracker::getCurrentFunction(), llvm::ModuleSlotTracker::getLocalSlot(), OS, llvm::MachineOperand::printIRSlotNumber(), and llvm::printLLVMNameWithoutPrefix().
Referenced by llvm::MachineMemOperand::print().