diff options
author | Alon Zakai <azakai@google.com> | 2019-05-10 10:23:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 10:23:58 -0700 |
commit | d216f8742ba0663fffb035c577a5449bbc8a33a2 (patch) | |
tree | d01bc76ad836d0874e22f27fde6df8aff4ff06d8 /src/wasm-type.h | |
parent | bdfdbfbbac4a0f47d8b789167697d6dd70a39720 (diff) | |
download | binaryen-d216f8742ba0663fffb035c577a5449bbc8a33a2.tar.gz binaryen-d216f8742ba0663fffb035c577a5449bbc8a33a2.tar.bz2 binaryen-d216f8742ba0663fffb035c577a5449bbc8a33a2.zip |
wasm2js: avoid reinterprets (#2094)
In JS a reinterpret is especially expensive, as we implement it as a write to a temp buffer and a read using another view. This finds places where we load a value from memory, then reinterpret it later - in that case, we can load it using another view, at the cost of another load and another local.
This is helpful on things like Box2D, where there are many reinterprets due to the main 2D vector class being an union over two floats/ints, and LLVM likes to do a single i64 load of them.
Diffstat (limited to 'src/wasm-type.h')
-rw-r--r-- | src/wasm-type.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm-type.h b/src/wasm-type.h index 6c8ea82a6..e685bc4b5 100644 --- a/src/wasm-type.h +++ b/src/wasm-type.h @@ -45,6 +45,7 @@ bool isFloatType(Type type); bool isIntegerType(Type type); bool isVectorType(Type type); bool isReferenceType(Type type); +Type reinterpretType(Type type); } // namespace wasm |