aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-29 21:50:34 +0000
committerDan Gohman <gohman@apple.com>2008-05-29 21:50:34 +0000
commitb4106170dde7db16af602e87bdd15ddc47e34321 (patch)
tree01ecdf44ad82e141923f016c9905ca551917b743 /utils
parenteecfa369eb91838fbd833183717b2579a0127acb (diff)
downloadexternal_llvm-b4106170dde7db16af602e87bdd15ddc47e34321.zip
external_llvm-b4106170dde7db16af602e87bdd15ddc47e34321.tar.gz
external_llvm-b4106170dde7db16af602e87bdd15ddc47e34321.tar.bz2
Add patterns for CALL32m and CALL64m. They aren't matched in most
cases due to an isel deficiency already noted in lib/Target/X86/README.txt, but they can be matched in this fold-call.ll testcase, for example. This is interesting mainly because it exposes a tricky tblgen bug; tblgen was incorrectly computing the starting index for variable_ops in the case of a complex pattern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index b112b7e..cf8c627 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -947,7 +947,7 @@ public:
// instruction operands to do this.
std::vector<std::string> AllOps;
unsigned NumEAInputs = 0; // # of synthesized 'execute always' inputs.
- unsigned NumDiscardedInputs = 0; // # of 'discard' inputs to skip.
+ unsigned InputIndex = 0;
for (unsigned ChildNo = 0, InstOpNo = NumResults;
InstOpNo != II.OperandList.size(); ++InstOpNo) {
std::vector<std::string> Ops;
@@ -956,7 +956,7 @@ public:
Record *OperandNode = II.OperandList[InstOpNo].Rec;
if (OperandNode->getName() == "discard") {
// This is a "discard" operand; emit nothing. Just note it.
- ++NumDiscardedInputs;
+ ++InputIndex;
} else if ((OperandNode->isSubClassOf("PredicateOperand") ||
OperandNode->isSubClassOf("OptionalDefOperand")) &&
!CGP.getDefaultOperand(OperandNode).DefaultOps.empty()) {
@@ -970,6 +970,7 @@ public:
AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());
NumEAInputs += Ops.size();
}
+ ++InputIndex;
} else {
// Otherwise this is a normal operand or a predicate operand without
// 'execute always'; emit it.
@@ -977,6 +978,7 @@ public:
InFlagDecled, ResNodeDecled);
AllOps.insert(AllOps.end(), Ops.begin(), Ops.end());
++ChildNo;
+ ++InputIndex;
}
}
@@ -1062,10 +1064,7 @@ public:
// number of operands that are 'execute always'. This is the index
// where we should start copying operands into the 'variable_ops'
// portion of the output.
- unsigned InputIndex = AllOps.size() +
- NumDiscardedInputs +
- NodeHasChain -
- NumEAInputs;
+ InputIndex += NodeHasChain - NumEAInputs;
for (unsigned i = 0, e = AllOps.size(); i != e; ++i)
emitCode("Ops" + utostr(OpsNo) + ".push_back(" + AllOps[i] + ");");