about summary refs log tree commit diff homepage
path: root/lib/Expr
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2018-10-17 23:13:53 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-10-23 18:53:46 +0300
commitece5e79dbc01b8f672799b22774ce73abd2721f3 (patch)
tree1f4f842081310f8212de8cec8c4c880ecee66fce /lib/Expr
parent713c1a3744aa8c0bfadf85a76377dd2c7dd63519 (diff)
downloadklee-ece5e79dbc01b8f672799b22774ce73abd2721f3.tar.gz
Move ConstantExpr check inside optimizeExpr function
Diffstat (limited to 'lib/Expr')
-rw-r--r--lib/Expr/ArrayExprOptimizer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Expr/ArrayExprOptimizer.cpp b/lib/Expr/ArrayExprOptimizer.cpp
index 2d817e83..fbaffc23 100644
--- a/lib/Expr/ArrayExprOptimizer.cpp
+++ b/lib/Expr/ArrayExprOptimizer.cpp
@@ -43,6 +43,10 @@ llvm::cl::opt<double> ArrayValueSymbRatio(
 };
 
 ref<Expr> ExprOptimizer::optimizeExpr(const ref<Expr> &e, bool valueOnly) {
+  // Nothing to optimise for constant expressions
+  if (isa<ConstantExpr>(e))
+    return e;
+
   unsigned hash = e->hash();
   if (cacheExprUnapplicable.find(hash) != cacheExprUnapplicable.end())
     return e;