summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-05-08 21:04:07 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-05-08 21:04:07 +0000
commit5162f584c788a4259fb66d4fb5b50c02c170bfb9 (patch)
tree66df0d1c486e48b6ad37e923b1c2eae55ea61370 /llvm/utils/TableGen
parent75d56499c69f035ce3affe2493be8454b223f30d (diff)
downloadbcm5719-llvm-5162f584c788a4259fb66d4fb5b50c02c170bfb9.tar.gz
bcm5719-llvm-5162f584c788a4259fb66d4fb5b50c02c170bfb9.zip
If a PredicateOperand has an empty ExecuteAlways field, treat it as if a normal operand for isel.
llvm-svn: 36946
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index e10558ef726..c3db37e696e 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -775,8 +775,10 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
Record *OperandNode = Inst.getOperand(i);
// If the instruction expects a predicate operand, we codegen this by
- // setting the predicate to it's "execute always" value.
- if (OperandNode->isSubClassOf("PredicateOperand"))
+ // setting the predicate to it's "execute always" value if it has a
+ // non-empty ExecuteAlways field.
+ if (OperandNode->isSubClassOf("PredicateOperand") &&
+ !ISE.getPredicateOperand(OperandNode).AlwaysOps.empty())
continue;
// Verify that we didn't run out of provided operands.
@@ -2801,8 +2803,11 @@ public:
InstOpNo != II.OperandList.size(); ++InstOpNo) {
std::vector<std::string> Ops;
- // If this is a normal operand, emit it.
- if (!II.OperandList[InstOpNo].Rec->isSubClassOf("PredicateOperand")) {
+ // If this is a normal operand or a predicate operand without
+ // 'execute always', emit it.
+ Record *OperandNode = II.OperandList[InstOpNo].Rec;
+ if (!OperandNode->isSubClassOf("PredicateOperand") ||
+ ISE.getPredicateOperand(OperandNode).AlwaysOps.empty()) {
Ops = EmitResultCode(N->getChild(ChildNo), RetSelected,
InFlagDecled, ResNodeDecled);
AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());
OpenPOWER on IntegriCloud