From 2516f059dbeb72ab7b869752c7dcd453a97fa2d4 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 19 Dec 2014 22:15:37 +0000 Subject: [PATCH] R600/SI: isLegalOperand() shouldn't check constant bus for SALU instructions The constant bus restrictions only apply to VALU instructions. This enables SIFoldOperands to fold immediates into SALU instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224623 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/SIInstrInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/R600/SIInstrInfo.cpp b/lib/Target/R600/SIInstrInfo.cpp index 08bfc5e1422..a58a46e862a 100644 --- a/lib/Target/R600/SIInstrInfo.cpp +++ b/lib/Target/R600/SIInstrInfo.cpp @@ -1405,7 +1405,7 @@ bool SIInstrInfo::isOperandLegal(const MachineInstr *MI, unsigned OpIdx, if (!MO) MO = &MI->getOperand(OpIdx); - if (usesConstantBus(MRI, *MO)) { + if (isVALU(InstDesc.Opcode) && usesConstantBus(MRI, *MO)) { unsigned SGPRUsed = MO->isReg() ? MO->getReg() : (unsigned)AMDGPU::NoRegister; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {