R600/SI: isLegalOperand() shouldn't check constant bus for SALU instructions
authorTom Stellard <thomas.stellard@amd.com>
Fri, 19 Dec 2014 22:15:37 +0000 (22:15 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 19 Dec 2014 22:15:37 +0000 (22:15 +0000)
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

index 08bfc5e142294873158b9e816e9f8c1c6d5e4654..a58a46e862ad6f4bb8abd639cd2b3b6620215f93 100644 (file)
@@ -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) {