aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-03 08:39:51 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-03 08:39:51 +0000
commitf9d0318950c60aa723ff650701f0365f0aafebd6 (patch)
tree1d3e8b2f30be9aff410e4b0a9a92a973c46dc67e /utils
parent10b9de62ff14069a4410f6005eaf71d353b2ac83 (diff)
isel load folding is disabled at -fast. Now hoist the check up to the top level to save some time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 890df90003..c6cac7d16a 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -206,6 +206,28 @@ static bool PatternHasProperty(TreePatternNode *N, SDNP Property,
return false;
}
+static std::string getOpcodeName(Record *Op, CodeGenDAGPatterns &CGP) {
+ return CGP.getSDNodeInfo(Op).getEnumName();
+}
+
+static
+bool DisablePatternForFastISel(TreePatternNode *N, CodeGenDAGPatterns &CGP) {
+ bool isStore = !N->isLeaf() &&
+ getOpcodeName(N->getOperator(), CGP) == "ISD::STORE";
+ if (!isStore && NodeHasProperty(N, SDNPHasChain, CGP))
+ return false;
+
+ bool HasChain = false;
+ for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i) {
+ TreePatternNode *Child = N->getChild(i);
+ if (PatternHasProperty(Child, SDNPHasChain, CGP)) {
+ HasChain = true;
+ break;
+ }
+ }
+ return HasChain;
+}
+
//===----------------------------------------------------------------------===//
// Node Transformation emitter implementation.
//
@@ -404,6 +426,9 @@ public:
// Record input varargs info.
NumInputRootOps = N->getNumChildren();
+ if (DisablePatternForFastISel(N, CGP))
+ emitCheck("!FastISel");
+
std::string PredicateCheck;
for (unsigned i = 0, e = Predicates->getSize(); i != e; ++i) {
if (DefInit *Pred = dynamic_cast<DefInit*>(Predicates->getElement(i))) {
@@ -480,10 +505,8 @@ public:
// / [YY]
// | ^
// [XX]-------|
- bool NeedCheck = false;
- if (P != Pattern)
- NeedCheck = true;
- else {
+ bool NeedCheck = P != Pattern;
+ if (!NeedCheck) {
const SDNodeInfo &PInfo = CGP.getSDNodeInfo(P->getOperator());
NeedCheck =
P->getOperator() == CGP.get_intrinsic_void_sdnode() ||
@@ -1548,10 +1571,6 @@ void DAGISelEmitter::EmitPatterns(std::vector<std::pair<const PatternToMatch*,
OS << std::string(Indent-2, ' ') << "}\n";
}
-static std::string getOpcodeName(Record *Op, CodeGenDAGPatterns &CGP) {
- return CGP.getSDNodeInfo(Op).getEnumName();
-}
-
static std::string getLegalCName(std::string OpName) {
std::string::size_type pos = OpName.find("::");
if (pos != std::string::npos)