Instructions with ImmutablePredicateOperand aren't really predicable since their...
authorEvan Cheng <evan.cheng@apple.com>
Thu, 5 Jul 2007 07:19:29 +0000 (07:19 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 5 Jul 2007 07:19:29 +0000 (07:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37899 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenTarget.cpp
utils/TableGen/InstrInfoEmitter.cpp

index c54ecd02e489d57945724136eb5af34d062bb621..e4d80ee669862639638c3605eff2af282b01a55b 100644 (file)
@@ -411,7 +411,10 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
       if (unsigned NumArgs = MIOpInfo->getNumArgs())
         NumOps = NumArgs;
 
-      isPredicable |= Rec->isSubClassOf("PredicateOperand");
+      if (Rec->isSubClassOf("PredicateOperand")) {
+        if (!Rec->getValueAsBit("isImmutable"))
+          isPredicable = true;
+      }
     } else if (Rec->getName() == "variable_ops") {
       hasVariableNumberOfOperands = true;
       continue;
index af01e4cd75a14e033cae3a1d2506ee1ff4f6e8b1..a57770de4689fbb87a035be0f12c7cc68133dcb6 100644 (file)
@@ -107,7 +107,8 @@ InstrInfoEmitter::GetOperandInfo(const CodeGenInstruction &Inst) {
 
       // Predicate operands.  Check to see if the original unexpanded operand
       // was of type PredicateOperand.
-      if (Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand"))
+      if (Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand") &&
+          !Inst.OperandList[i].Rec->getValueAsBit("isImmutable"))
         Res += "|M_PREDICATE_OPERAND";
         
       // Fill in constraint info.