recognize ppc's blr instruction as predicated
authorChris Lattner <sabre@nondot.org>
Mon, 6 Nov 2006 21:44:54 +0000 (21:44 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 6 Nov 2006 21:44:54 +0000 (21:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31480 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenInstruction.h
utils/TableGen/CodeGenTarget.cpp
utils/TableGen/InstrInfoEmitter.cpp

index e1c4c7d6d310762cf604fb722681f490ac6a9669..26423d02ffc2dc69a3dfd1f3e77d6cf63e06080b 100644 (file)
@@ -87,6 +87,7 @@ namespace llvm {
     bool isLoad;
     bool isStore;
     bool isTwoAddress;
+    bool isPredicated;
     bool isConvertibleToThreeAddress;
     bool isCommutable;
     bool isTerminator;
index f8410c17ff4f57f7f139ec0a4f6d7d6cd9a63867..5893a58623a7d63e87aae0a8556102d12e412174 100644 (file)
@@ -335,6 +335,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
   isLoad       = R->getValueAsBit("isLoad");
   isStore      = R->getValueAsBit("isStore");
   isTwoAddress = R->getValueAsBit("isTwoAddress");
+  isPredicated = false;   // set below.
   isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress");
   isCommutable = R->getValueAsBit("isCommutable");
   isTerminator = R->getValueAsBit("isTerminator");
@@ -381,6 +382,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
       if (unsigned NumArgs = MIOpInfo->getNumArgs())
         NumOps = NumArgs;
 
+      isPredicated |= Rec->isSubClassOf("PredicateOperand");
     } else if (Rec->getName() == "variable_ops") {
       hasVariableNumberOfOperands = true;
       continue;
index bf69d08523a6873627f62737893360df8a0f2443..41fb6969944ecfff374c30e28acee3c4681562d5 100644 (file)
@@ -225,6 +225,7 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
   if (Inst.isLoad)       OS << "|M_LOAD_FLAG";
   if (Inst.isStore || isStore) OS << "|M_STORE_FLAG";
   if (Inst.isTwoAddress) OS << "|M_2_ADDR_FLAG";
+  if (Inst.isPredicated) OS << "|M_PREDICATED";
   if (Inst.isConvertibleToThreeAddress) OS << "|M_CONVERTIBLE_TO_3_ADDR";
   if (Inst.isCommutable) OS << "|M_COMMUTABLE";
   if (Inst.isTerminator) OS << "|M_TERMINATOR_FLAG";