diff options
author | Max Graey <maxgraey@gmail.com> | 2021-08-06 00:51:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-05 14:51:15 -0700 |
commit | cbe4b578a639ede260f33fc4ebcde17fcbf4ccc2 (patch) | |
tree | a5cca5cd60c69b8e228a853ff06ef159eca8adc5 /src/passes/OptimizeForJS.cpp | |
parent | 243ac8942e1e0136b8d91242642d9bc825a9cfd9 (diff) | |
download | binaryen-cbe4b578a639ede260f33fc4ebcde17fcbf4ccc2.tar.gz binaryen-cbe4b578a639ede260f33fc4ebcde17fcbf4ccc2.tar.bz2 binaryen-cbe4b578a639ede260f33fc4ebcde17fcbf4ccc2.zip |
[OptimizeForJS] Fix use of localized variable in popcnt(x) == 1 rule (#4057)
Localizer may have added a new tee and a local, and we should apply
the tee in the right place.
Diffstat (limited to 'src/passes/OptimizeForJS.cpp')
-rw-r--r-- | src/passes/OptimizeForJS.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/passes/OptimizeForJS.cpp b/src/passes/OptimizeForJS.cpp index b5ba84d90..589374c06 100644 --- a/src/passes/OptimizeForJS.cpp +++ b/src/passes/OptimizeForJS.cpp @@ -54,9 +54,7 @@ struct OptimizeForJSPass : public WalkerPass<PostWalker<OptimizeForJSPass>> { replaceCurrent(builder.makeBinary( AndInt32, - builder.makeUnary( - EqZInt32, - builder.makeUnary(eqzOp, builder.makeLocalGet(temp.index, type))), + builder.makeUnary(EqZInt32, builder.makeUnary(eqzOp, temp.expr)), builder.makeUnary( eqzOp, builder.makeBinary( |