diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-12-17 15:14:54 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-12-17 15:14:54 +0000 |
commit | 3ee6391e0cddf8d94e2fa441d661c23e494a8489 (patch) | |
tree | 09b968b7662f0697c78b60c38c446da7f897444c /lib/Target/R600/AMDGPUMCInstLower.cpp | |
parent | ab8ada34c0dcb2381bfd6858461479fffb0c7992 (diff) | |
download | llvm-3ee6391e0cddf8d94e2fa441d661c23e494a8489.tar.gz llvm-3ee6391e0cddf8d94e2fa441d661c23e494a8489.tar.bz2 llvm-3ee6391e0cddf8d94e2fa441d661c23e494a8489.tar.xz |
R600: BB operand support for SI
Patch by: Christian König
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170342 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/AMDGPUMCInstLower.cpp')
-rw-r--r-- | lib/Target/R600/AMDGPUMCInstLower.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Target/R600/AMDGPUMCInstLower.cpp b/lib/Target/R600/AMDGPUMCInstLower.cpp index de4053ea09..32275a2b04 100644 --- a/lib/Target/R600/AMDGPUMCInstLower.cpp +++ b/lib/Target/R600/AMDGPUMCInstLower.cpp @@ -21,11 +21,14 @@ #include "llvm/Constants.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCStreamer.h" +#include "llvm/MC/MCExpr.h" #include "llvm/Support/ErrorHandling.h" using namespace llvm; -AMDGPUMCInstLower::AMDGPUMCInstLower() { } +AMDGPUMCInstLower::AMDGPUMCInstLower(MCContext &ctx): + Ctx(ctx) +{ } void AMDGPUMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const { OutMI.setOpcode(MI->getOpcode()); @@ -50,13 +53,16 @@ void AMDGPUMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const { case MachineOperand::MO_Register: MCOp = MCOperand::CreateReg(MO.getReg()); break; + case MachineOperand::MO_MachineBasicBlock: + MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create( + MO.getMBB()->getSymbol(), Ctx)); } OutMI.addOperand(MCOp); } } void AMDGPUAsmPrinter::EmitInstruction(const MachineInstr *MI) { - AMDGPUMCInstLower MCInstLowering; + AMDGPUMCInstLower MCInstLowering(OutContext); if (MI->isBundle()) { const MachineBasicBlock *MBB = MI->getParent(); |