[llvm-commits] [llvm] r38498 - in /llvm/trunk/utils/TableGen: CodeGenInstruction.h CodeGenTarget.cpp InstrInfoEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Tue Jul 10 11:05:01 PDT 2007
Author: evancheng
Date: Tue Jul 10 13:05:01 2007
New Revision: 38498
URL: http://llvm.org/viewvc/llvm-project?rev=38498&view=rev
Log:
Try committing again. Add OptionalDefOperand. Remove clobbersPred.
Modified:
llvm/trunk/utils/TableGen/CodeGenInstruction.h
llvm/trunk/utils/TableGen/CodeGenTarget.cpp
llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=38498&r1=38497&r2=38498&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Tue Jul 10 13:05:01 2007
@@ -97,8 +97,8 @@
bool hasVariableNumberOfOperands;
bool hasCtrlDep;
bool noResults;
- bool clobbersPred;
bool isNotDuplicable;
+ bool hasOptionalDef;
/// ParseOperandName - Parse an operand name like "$foo" or "$foo.bar",
/// where $foo is a whole operand and $foo.bar refers to a suboperand.
Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=38498&r1=38497&r2=38498&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Tue Jul 10 13:05:01 2007
@@ -370,8 +370,8 @@
usesCustomDAGSchedInserter = R->getValueAsBit("usesCustomDAGSchedInserter");
hasCtrlDep = R->getValueAsBit("hasCtrlDep");
noResults = R->getValueAsBit("noResults");
- clobbersPred = R->getValueAsBit("clobbersPred");
isNotDuplicable = R->getValueAsBit("isNotDuplicable");
+ hasOptionalDef = false;
hasVariableNumberOfOperands = false;
DagInit *DI;
@@ -411,9 +411,10 @@
if (unsigned NumArgs = MIOpInfo->getNumArgs())
NumOps = NumArgs;
- if (Rec->isSubClassOf("PredicateOperand")) {
+ if (Rec->isSubClassOf("PredicateOperand"))
isPredicable = true;
- }
+ else if (Rec->isSubClassOf("OptionalDefOperand"))
+ hasOptionalDef = true;
} else if (Rec->getName() == "variable_ops") {
hasVariableNumberOfOperands = true;
continue;
Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=38498&r1=38497&r2=38498&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Tue Jul 10 13:05:01 2007
@@ -110,6 +110,11 @@
if (Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand"))
Res += "|M_PREDICATE_OPERAND";
+ // Optional def operands. Check to see if the original unexpanded operand
+ // was of type OptionalDefOperand.
+ if (Inst.OperandList[i].Rec->isSubClassOf("OptionalDefOperand"))
+ Res += "|M_OPTIONAL_DEF_OPERAND";
+
// Fill in constraint info.
Res += ", " + Inst.OperandList[i].Constraints[j];
Result.push_back(Res);
@@ -241,8 +246,8 @@
if (Inst.isCommutable) OS << "|M_COMMUTABLE";
if (Inst.isTerminator) OS << "|M_TERMINATOR_FLAG";
if (Inst.isReMaterializable) OS << "|M_REMATERIALIZIBLE";
- if (Inst.clobbersPred) OS << "|M_CLOBBERS_PRED";
if (Inst.isNotDuplicable) OS << "|M_NOT_DUPLICABLE";
+ if (Inst.hasOptionalDef) OS << "|M_HAS_OPTIONAL_DEF";
if (Inst.usesCustomDAGSchedInserter)
OS << "|M_USES_CUSTOM_DAG_SCHED_INSERTION";
if (Inst.hasVariableNumberOfOperands)
More information about the llvm-commits
mailing list