[llvm] r206497 - R600/SI: Legalize operands after changing dst reg in FixSGPRCopies

Tom Stellard thomas.stellard at amd.com
Thu Apr 17 14:00:01 PDT 2014


Author: tstellar
Date: Thu Apr 17 16:00:01 2014
New Revision: 206497

URL: http://llvm.org/viewvc/llvm-project?rev=206497&view=rev
Log:
R600/SI: Legalize operands after changing dst reg in FixSGPRCopies

Otherwise we may not legalize some illegal REG_SEQUENCE 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=206497&r1=206496&r2=206497&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.cpp Thu Apr 17 16:00:01 2014
@@ -991,9 +991,8 @@ void SIInstrInfo::moveToVALU(MachineInst
       }
     }
 
-    legalizeOperands(Inst);
-
     // Update the destination register class.
+
     const TargetRegisterClass *NewDstRC = getOpRegClass(*Inst, 0);
 
     switch (Inst->getOpcode()) {
@@ -1019,6 +1018,9 @@ void SIInstrInfo::moveToVALU(MachineInst
     unsigned NewDstReg = MRI.createVirtualRegister(NewDstRC);
     MRI.replaceRegWith(DstReg, NewDstReg);
 
+    // Legalize the operands
+    legalizeOperands(Inst);
+
     for (MachineRegisterInfo::use_iterator I = MRI.use_begin(NewDstReg),
            E = MRI.use_end(); I != E; ++I) {
       MachineInstr &UseMI = *I->getParent();





More information about the llvm-commits mailing list