diff options
author | Tom Stellard <[email protected]> | 2012-05-09 11:44:27 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-05-09 12:49:44 -0400 |
commit | c2e081030e5c6f96ea3eb9948e5c0d0d2ed79a3d (patch) | |
tree | ea63ad91ce4c363dcbc64c4af81f0e636d0fd537 /src/gallium/drivers/radeon/R600ISelLowering.cpp | |
parent | d0403cafd479964a80d95299d079845593e9891f (diff) |
radeon/llvm: Don't rely on tablegen for lowering int_AMDGPU_load_const
Diffstat (limited to 'src/gallium/drivers/radeon/R600ISelLowering.cpp')
-rw-r--r-- | src/gallium/drivers/radeon/R600ISelLowering.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/R600ISelLowering.cpp b/src/gallium/drivers/radeon/R600ISelLowering.cpp index bee59cc0d7b..52e2bd8d3f3 100644 --- a/src/gallium/drivers/radeon/R600ISelLowering.cpp +++ b/src/gallium/drivers/radeon/R600ISelLowering.cpp @@ -40,6 +40,7 @@ MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter( { MachineFunction * MF = BB->getParent(); MachineRegisterInfo &MRI = MF->getRegInfo(); + MachineBasicBlock::iterator I = *MI; switch (MI->getOpcode()) { default: return AMDGPUTargetLowering::EmitInstrWithCustomInserter(MI, BB); @@ -89,6 +90,18 @@ MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter( case AMDIL::LOCAL_SIZE_Z: lowerImplicitParameter(MI, *BB, MRI, 8); break; + + case AMDIL::R600_LOAD_CONST: + { + int64_t RegIndex = MI->getOperand(1).getImm(); + unsigned ConstantReg = AMDIL::R600_CReg32RegClass.getRegister(RegIndex); + BuildMI(*BB, I, BB->findDebugLoc(I), TII->get(AMDIL::COPY)) + .addOperand(MI->getOperand(0)) + .addReg(ConstantReg); + MI->eraseFromParent(); + break; + } + case AMDIL::LOAD_INPUT: { int64_t RegIndex = MI->getOperand(1).getImm(); @@ -99,7 +112,6 @@ MachineBasicBlock * R600TargetLowering::EmitInstrWithCustomInserter( } case AMDIL::STORE_OUTPUT: { - MachineBasicBlock::iterator I = *MI; int64_t OutputIndex = MI->getOperand(1).getImm(); unsigned OutputReg = AMDIL::R600_TReg32RegClass.getRegister(OutputIndex); |