diff options
Diffstat (limited to 'tools/eliminator')
-rw-r--r-- | tools/eliminator/asm-eliminator-test-output.js | 4 | ||||
-rw-r--r-- | tools/eliminator/asm-eliminator-test.js | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js index 4cd9cbaa..b519cdf9 100644 --- a/tools/eliminator/asm-eliminator-test-output.js +++ b/tools/eliminator/asm-eliminator-test-output.js @@ -129,4 +129,8 @@ function confuusion() { j = i; func2(+j); } +function tempDouble(a) { + a = +a; + f(a * a); +} diff --git a/tools/eliminator/asm-eliminator-test.js b/tools/eliminator/asm-eliminator-test.js index 9dc71835..ff67af47 100644 --- a/tools/eliminator/asm-eliminator-test.js +++ b/tools/eliminator/asm-eliminator-test.js @@ -162,5 +162,13 @@ function confuusion() { var j = i; // add this var in the middle. should show up with right type later, auto-inferred from i's type func2(+j); } -// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label", "confuusion"] +function tempDouble(a) { + a = +a; + var x = +0, y = +0; + // CastAway can leave things like this as variables no longer needed. We need to identify that x's value has no side effects so it can be completely cleaned up + x = (HEAP32[((tempDoublePtr)>>2)]=((HEAP32[(($_sroa_0_0__idx1)>>2)])|0),HEAP32[(((tempDoublePtr)+(4))>>2)]=((HEAP32[((($_sroa_0_0__idx1)+(4))>>2)])|0),(+(HEAPF64[(tempDoublePtr)>>3]))); + y = a*a; + f(y); +} +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label", "confuusion", "tempDouble"] |