From 4be7ec00157250ca83b61a2e1885645c67c6369c Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Mon, 10 Jul 2017 18:48:02 -0700 Subject: handle unary and binary nodes that have implicit traps in vacuum --- test/passes/vacuum.txt | 13 +++++++++++++ test/passes/vacuum.wast | 13 +++++++++++++ test/passes/vacuum_ignore-implicit-traps.txt | 4 ++++ test/passes/vacuum_ignore-implicit-traps.wast | 13 +++++++++++++ 4 files changed, 43 insertions(+) (limited to 'test') diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt index f17607734..e07357296 100644 --- a/test/passes/vacuum.txt +++ b/test/passes/vacuum.txt @@ -260,4 +260,17 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap (type $0) + (drop + (i64.div_s + (i64.const -1) + (i64.const 729618461987467893) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const 70847791997969805621592064) + ) + ) + ) ) diff --git a/test/passes/vacuum.wast b/test/passes/vacuum.wast index 65e528621..77ffabd60 100644 --- a/test/passes/vacuum.wast +++ b/test/passes/vacuum.wast @@ -580,4 +580,17 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap + (drop + (i64.div_s + (i64.const 70847791997969805621592064) + (i64.const 729618461987467893) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const 70847791997969805621592064) + ) + ) + ) ) diff --git a/test/passes/vacuum_ignore-implicit-traps.txt b/test/passes/vacuum_ignore-implicit-traps.txt index 040a3dc1a..e5ff28583 100644 --- a/test/passes/vacuum_ignore-implicit-traps.txt +++ b/test/passes/vacuum_ignore-implicit-traps.txt @@ -1,5 +1,6 @@ (module (type $0 (func (result i32))) + (type $1 (func)) (memory $0 0) (func $load-would-normally-have-side-effects (type $0) (result i32) (i64.ge_s @@ -7,4 +8,7 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap (type $1) + (nop) + ) ) diff --git a/test/passes/vacuum_ignore-implicit-traps.wast b/test/passes/vacuum_ignore-implicit-traps.wast index 08b41a141..21e87e10c 100644 --- a/test/passes/vacuum_ignore-implicit-traps.wast +++ b/test/passes/vacuum_ignore-implicit-traps.wast @@ -15,5 +15,18 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap + (drop + (i64.div_s + (i64.const 70847791997969805621592064) + (i64.const 729618461987467893) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const 70847791997969805621592064) + ) + ) + ) ) -- cgit v1.2.3