[llvm] r218528 - R600/SI: Don't assert on exotic operand types

Matt Arsenault Matthew.Arsenault at amd.com
Fri Sep 26 10:54:46 PDT 2014


Author: arsenm
Date: Fri Sep 26 12:54:46 2014
New Revision: 218528

URL: http://llvm.org/viewvc/llvm-project?rev=218528&view=rev
Log:
R600/SI: Don't assert on exotic operand types

This needs a test, but I'm not sure if it is currently possible and
I originally hit it due to a bug. Right now the only global address
operands have no reason to be VALU instructions, although it
theoretically could be a problem.

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=218528&r1=218527&r2=218528&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.cpp Fri Sep 26 12:54:46 2014
@@ -705,7 +705,7 @@ MachineInstr *SIInstrInfo::commuteInstru
 
   if (Src1Idx != -1 && !MI->getOperand(Src1Idx).isReg()) {
     // XXX: Commute instructions with FPImm operands
-    if (NewMI || MI->getOperand(Src1Idx).isFPImm() ||
+    if (NewMI || !MI->getOperand(Src1Idx).isImm() ||
        (!isVOP2(MI->getOpcode()) && !isVOP3(MI->getOpcode()))) {
       return nullptr;
     }





More information about the llvm-commits mailing list