diff options
author | Martin Nowack <m.nowack@imperial.ac.uk> | 2018-10-18 11:31:05 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-10-23 18:53:46 +0300 |
commit | 93e5530db7fc86f165b1a0a2188d17b0078cb981 (patch) | |
tree | 33dcd1ef72f9345711de3461d4fcd5755a8c1988 /lib/Expr | |
parent | ece5e79dbc01b8f672799b22774ce73abd2721f3 (diff) | |
download | klee-93e5530db7fc86f165b1a0a2188d17b0078cb981.tar.gz |
Remove condition check before function invocation
Conditions are checked inside of `optimizeExpr()` anyway. This simplifies the code a lot.
Diffstat (limited to 'lib/Expr')
-rw-r--r-- | lib/Expr/ArrayExprOptimizer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Expr/ArrayExprOptimizer.cpp b/lib/Expr/ArrayExprOptimizer.cpp index fbaffc23..0929efb5 100644 --- a/lib/Expr/ArrayExprOptimizer.cpp +++ b/lib/Expr/ArrayExprOptimizer.cpp @@ -47,6 +47,10 @@ ref<Expr> ExprOptimizer::optimizeExpr(const ref<Expr> &e, bool valueOnly) { if (isa<ConstantExpr>(e)) return e; + // If no is optimization enabled, return early avoid cache lookup + if (OptimizeArray == NONE) + return e; + unsigned hash = e->hash(); if (cacheExprUnapplicable.find(hash) != cacheExprUnapplicable.end()) return e; |