diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-11-14 16:42:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-14 16:42:25 -0800 |
commit | 4deed1eb310993391fa0e7e06a18cf2303674f98 (patch) | |
tree | 16028717e26ec439fe0e8f5b2e40988fcc92f2e9 /src/passes/OptimizeInstructions.cpp | |
parent | 82d693b2bd23778b29bbd1019936a2857580c7ed (diff) | |
download | binaryen-4deed1eb310993391fa0e7e06a18cf2303674f98.tar.gz binaryen-4deed1eb310993391fa0e7e06a18cf2303674f98.tar.bz2 binaryen-4deed1eb310993391fa0e7e06a18cf2303674f98.zip |
add i64_atomics_* support to asm2wasm (#1262)
* add i64_atomics_* support to asm2wasm
* OptimizeInstructions: atomic loads can't be signed
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
-rw-r--r-- | src/passes/OptimizeInstructions.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 5194c8ce7..37fb37ace 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -422,7 +422,8 @@ struct OptimizeInstructions : public WalkerPass<PostWalker<OptimizeInstructions, if (extraShifts == 0) { if (auto* load = getFallthrough(ext)->dynCast<Load>()) { // pattern match a load of 8 bits and a sign extend using a shl of 24 then shr_s of 24 as well, etc. - if ((load->bytes == 1 && bits == 8) || (load->bytes == 2 && bits == 16)) { + if (LoadUtils::canBeSigned(load) && + ((load->bytes == 1 && bits == 8) || (load->bytes == 2 && bits == 16))) { // if the value falls through, we can't alter the load, as it might be captured in a tee if (load->signed_ == true || load == ext) { load->signed_ = true; |