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
This commit is contained in:
Evan Cheng 2007-05-08 21:04:07 +00:00
parent a7a5bad38c
commit 59039632e1

View File

@ -775,8 +775,10 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
Record *OperandNode = Inst.getOperand(i); Record *OperandNode = Inst.getOperand(i);
// If the instruction expects a predicate operand, we codegen this by // If the instruction expects a predicate operand, we codegen this by
// setting the predicate to it's "execute always" value. // setting the predicate to it's "execute always" value if it has a
if (OperandNode->isSubClassOf("PredicateOperand")) // non-empty ExecuteAlways field.
if (OperandNode->isSubClassOf("PredicateOperand") &&
!ISE.getPredicateOperand(OperandNode).AlwaysOps.empty())
continue; continue;
// Verify that we didn't run out of provided operands. // Verify that we didn't run out of provided operands.
@ -2801,8 +2803,11 @@ public:
InstOpNo != II.OperandList.size(); ++InstOpNo) { InstOpNo != II.OperandList.size(); ++InstOpNo) {
std::vector<std::string> Ops; std::vector<std::string> Ops;
// If this is a normal operand, emit it. // If this is a normal operand or a predicate operand without
if (!II.OperandList[InstOpNo].Rec->isSubClassOf("PredicateOperand")) { // '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, Ops = EmitResultCode(N->getChild(ChildNo), RetSelected,
InFlagDecled, ResNodeDecled); InFlagDecled, ResNodeDecled);
AllOps.insert(AllOps.end(), Ops.begin(), Ops.end()); AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());