summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDejan Jovanović <dejan.jovanovic@gmail.com>2012-03-28 01:28:08 +0000
committerDejan Jovanović <dejan.jovanovic@gmail.com>2012-03-28 01:28:08 +0000
commit2eec05ba299532c663fffc4262467a9b6771c2c4 (patch)
tree7db3b4148bcf22d69c1dcb493ec57b02ac2fbd52
parent6fdc62f34bb1d04b84dfd628ec16335b8f02385e (diff)
adding an extra cache check in the rewriter, speeds things a bit
http://church.cims.nyu.edu/regress-results/compare_jobs.php?job_id=3828&category=&p=5&reference_id=3820
-rw-r--r--src/theory/rewriter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/theory/rewriter.cpp b/src/theory/rewriter.cpp
index fddbbcd13..4f9075f52 100644
--- a/src/theory/rewriter.cpp
+++ b/src/theory/rewriter.cpp
@@ -71,6 +71,12 @@ Node Rewriter::rewriteTo(theory::TheoryId theoryId, Node node) {
Trace("rewriter") << "Rewriter::rewriteTo(" << theoryId << "," << node << ")"<< std::endl;
+ // Check if it's been cached already
+ Node cached = getPostRewriteCache(theoryId, node);
+ if (!cached.isNull()) {
+ return cached;
+ }
+
// Put the node on the stack in order to start the "recursive" rewrite
vector<RewriteStackElement> rewriteStack;
rewriteStack.push_back(RewriteStackElement(node, theoryId));
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback