From 8a4c25dd7e9002ab7a2821753bcae1ff6af2ca1c Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 8 May 2012 11:33:05 -0400 Subject: radeon/llvm: Use a custom inserter to lower RESERVE_REG --- src/gallium/drivers/radeon/R600ISelLowering.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gallium/drivers/radeon/R600ISelLowering.cpp') diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index 9870b7ba820..7e1c17dfcaf 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -13,6 +13,7 @@ #include "R600ISelLowering.h" #include "R600InstrInfo.h" +#include "R600MachineFunctionInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" using namespace llvm; @@ -112,7 +113,19 @@ MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter( MI->eraseFromParent(); break; } + + case AMDIL::RESERVE_REG: + { + R600MachineFunctionInfo * MFI = MF->getInfo(); + int64_t ReservedIndex = MI->getOperand(0).getImm(); + unsigned ReservedReg = + AMDIL::R600_TReg32RegClass.getRegister(ReservedIndex); + MFI->ReservedRegs.push_back(ReservedReg); + MI->eraseFromParent(); + break; + } } + return BB; } -- cgit v1.2.3