diff options
author | Alon Zakai <alonzakai@gmail.com> | 2019-02-25 10:04:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-25 10:04:09 -0800 |
commit | 605e2b7498a7979b59917aa5db17d5022e974c8b (patch) | |
tree | 9cf62a6a4191a8125d86b9d17f272269ea2b8834 /src/passes/SimplifyLocals.cpp | |
parent | f11b7e712fab6f11ce9f51b85459ab199e817cae (diff) | |
download | binaryen-605e2b7498a7979b59917aa5db17d5022e974c8b.tar.gz binaryen-605e2b7498a7979b59917aa5db17d5022e974c8b.tar.bz2 binaryen-605e2b7498a7979b59917aa5db17d5022e974c8b.zip |
SmallVector (#1912)
Trying to refactor the code to be simpler and less redundant, I ran into some perf issues that it seems like a small vector, with fixed-size storage and optional additional storage as needed, might help with. This implements that class and uses it in a few places.
This seems to help, I see some 1-2% fewer instructions and cycles in `perf stat`, but it's hard to tell if it really makes a noticeable difference.
Diffstat (limited to 'src/passes/SimplifyLocals.cpp')
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index 91f0f8d4f..a4931f06c 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -271,7 +271,7 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals<a // a full expression stack is used when !allowNesting, so that we can check if // a sink would cause nesting - std::vector<Expression*> expressionStack; + ExpressionStack expressionStack; static void visitPre(SimplifyLocals<allowTee, allowStructure, allowNesting>* self, Expression** currp) { Expression* curr = *currp; |