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.

llvm-svn: 224623

llvm/lib/Target/R600/SIInstrInfo.cpp

index 08bfc5e..a58a46e 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) {