From fac8d7ecb1eed9a456125953fed5cf1d31133580 Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Fri, 13 May 2016 20:39:20 +0000 Subject: [PATCH] AMDGPU/R600: There are other uses for ALU_LITERAL besides Imm This will be used for GV Reviewers: tstellard Subscribers: arsenm Differential Revision: http://reviews.llvm.org/D19788 llvm-svn: 269475 --- llvm/lib/Target/AMDGPU/R600InstrInfo.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp b/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp index 6f2288b8bee67..20415181b2ac9 100644 --- a/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/R600InstrInfo.cpp @@ -337,10 +337,13 @@ R600InstrInfo::getSrcs(MachineInstr *MI) const { continue; } if (Reg == AMDGPU::ALU_LITERAL_X) { - MachineOperand &Imm = MI->getOperand( + MachineOperand &Operand = MI->getOperand( getOperandIdx(MI->getOpcode(), AMDGPU::OpName::literal)); - Result.push_back(std::make_pair(&MO, Imm.getImm())); - continue; + if (Operand.isImm()) { + Result.push_back(std::make_pair(&MO, Operand.getImm())); + continue; + } + assert(Operand.isGlobal()); } Result.push_back(std::make_pair(&MO, 0)); }