From 59039632e120de996f36db707e4718b469c7228b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 8 May 2007 21:04:07 +0000 Subject: If a PredicateOperand has an empty ExecuteAlways field, treat it as if a normal operand for isel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36946 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/DAGISelEmitter.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'utils/TableGen') diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index e10558e..c3db37e 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/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 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()); -- cgit v1.1