diff options
Diffstat (limited to 'lib/Target/R600/AMDGPUIndirectAddressing.cpp')
-rw-r--r-- | lib/Target/R600/AMDGPUIndirectAddressing.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/R600/AMDGPUIndirectAddressing.cpp b/lib/Target/R600/AMDGPUIndirectAddressing.cpp index ed6c8ec..3ce3ecf 100644 --- a/lib/Target/R600/AMDGPUIndirectAddressing.cpp +++ b/lib/Target/R600/AMDGPUIndirectAddressing.cpp @@ -39,7 +39,7 @@ private: public: AMDGPUIndirectAddressingPass(TargetMachine &tm) : MachineFunctionPass(ID), - TII(static_cast<const AMDGPUInstrInfo*>(tm.getInstrInfo())) + TII(0) { } virtual bool runOnMachineFunction(MachineFunction &MF); @@ -59,6 +59,8 @@ FunctionPass *llvm::createAMDGPUIndirectAddressingPass(TargetMachine &tm) { bool AMDGPUIndirectAddressingPass::runOnMachineFunction(MachineFunction &MF) { MachineRegisterInfo &MRI = MF.getRegInfo(); + TII = static_cast<const AMDGPUInstrInfo*>(MF.getTarget().getInstrInfo()); + int IndirectBegin = TII->getIndirectIndexBegin(MF); int IndirectEnd = TII->getIndirectIndexEnd(MF); @@ -224,7 +226,7 @@ bool AMDGPUIndirectAddressingPass::runOnMachineFunction(MachineFunction &MF) { unsigned LiveAddress = RegisterAddressMap[Reg]; // Chain the live-ins if (LiveAddressRegisterMap.find(LiveAddress) != - RegisterAddressMap.end()) { + LiveAddressRegisterMap.end()) { MI.addOperand(MachineOperand::CreateReg( LiveAddressRegisterMap[LiveAddress], false, // isDef |