[llvm] r224623 - R600/SI: isLegalOperand() shouldn't check constant bus for SALU instructions

Tom Stellard thomas.stellard at amd.com
Fri Dec 19 14:15:37 PST 2014


Author: tstellar
Date: Fri Dec 19 16:15:37 2014
New Revision: 224623

URL: http://llvm.org/viewvc/llvm-project?rev=224623&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/R600/SIInstrInfo.cpp

Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.cpp?rev=224623&r1=224622&r2=224623&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.cpp Fri Dec 19 16:15:37 2014
@@ -1405,7 +1405,7 @@ bool SIInstrInfo::isOperandLegal(const M
   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) {





More information about the llvm-commits mailing list