Add CC operand as 4th operand of SUBcc, and mark it as a def.
authorVikram S. Adve <vadve@cs.uiuc.edu>
Mon, 6 Aug 2001 21:06:10 +0000 (21:06 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Mon, 6 Aug 2001 21:06:10 +0000 (21:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp

index 901ad0053f422d1f050680ac1f0bcca48fde9df3..b472febbddd7954cabb1357ccde06fa6a96bf45a 100644 (file)
@@ -479,12 +479,11 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
        mvec[0] = new MachineInstr(SUBcc);
        Set3OperandsFromInstr(mvec[0], subtreeRoot, target, discardResult);
        
-       if (discardResult)
-         {// mark the "result" operand as being a CC register
-           mvec[0]->SetMachineOperand(2, MachineOperand::MO_CCRegister,
-                                         subtreeRoot->getValue());
-         }
-       else
+       // mark the 4th operand as being a CC register, and a "result"
+       mvec[0]->SetMachineOperand(3, MachineOperand::MO_CCRegister,
+                                     subtreeRoot->getValue(), /*def*/ true);
+       
+       if (!discardResult) 
          { // recompute bool if needed, using the integer condition codes
            if (result->getOpcode() == Instruction::SetNE)
              discardResult = true;