LLVM: lib/Target/AMDGPU/R600MCInstLower.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
22
23using namespace llvm;
24
25namespace {
27public:
28 R600MCInstLower(MCContext &ctx, const R600Subtarget &ST,
29 const AsmPrinter &AP);
30
31
32 void lower(const MachineInstr *MI, MCInst &OutMI) const;
33};
34}
35
39
42 for (const MachineOperand &MO : MI->explicit_operands()) {
43 MCOperand MCOp;
44 lowerOperand(MO, MCOp);
46 }
47}
48
50 R600_MC::verifyInstructionPredicates(MI->getOpcode(),
52
54 R600MCInstLower MCInstLowering(OutContext, STI, *this);
55
57 if (!STI.getInstrInfo()->verifyInstruction(*MI, Err)) {
58 LLVMContext &C = MI->getMF()->getFunction().getContext();
59 C.emitError("Illegal instruction detected: " + Err);
61 }
62
63 if (MI->isBundle()) {
66 while (I != MBB->instr_end() && I->isInsideBundle()) {
68 ++I;
69 }
70 } else {
72 MCInstLowering.lower(MI, TmpInst);
74 }
75}
76
Header of lower AMDGPU MachineInstrs to their corresponding MCInst.
R600 Assembly printer class.
Provides R600 specific target descriptions.
AMDGPU R600 specific subclass of TargetSubtarget.
static SDValue lowerAddrSpaceCast(SDValue Op, SelectionDAG &DAG)
This class is intended to be used as a driving class for all asm writers.
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
TargetMachine & TM
Target machine description.
MachineFunction * MF
The current machine function.
virtual const MCExpr * lowerConstant(const Constant *CV, const Constant *BaseCV=nullptr, uint64_t Offset=0)
Lower the specified LLVM Constant to an MCExpr.
MCContext & OutContext
This is the context for the output file that we are streaming.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
This is an important base class in LLVM.
This is an important class for using LLVM in a threaded context.
Context object for machine code objects.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
Instructions::const_iterator const_instr_iterator
Representation of each machine instruction.
const MCExpr * lowerConstant(const Constant *CV, const Constant *BaseCV, uint64_t Offset) override
Lower the specified LLVM Constant to an MCExpr.
Definition R600MCInstLower.cpp:77
void emitInstruction(const MachineInstr *MI) override
Implemented in AMDGPUMCInstLower.cpp.
Definition R600MCInstLower.cpp:49
const R600InstrInfo * getInstrInfo() const override
StringRef - Represent a constant reference to a string, i.e.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.