From 5854873dfbf291018853f9da62c9cdb55007b27f Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 3 Oct 2023 15:17:31 -0700 Subject: Asyncify: Simpify if into i32.or (#5988) ```wast (if (result i32) (expr0) (i32.const 1) (expr1) ) ``` can be written as ```wast (i32.or (expr0) (expr1) ) ``` Also this removes some unused variables and methods. This also adds an optimization for ```wast (i32.eqz (global.get $__asyncify_state) ) ``` in `--mod-asyncify-always-and-only-unwind` to fix an unexpected regression caused by this. --- .../passes/asyncify_pass-arg=asyncify-ignore-indirect.wast | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast') diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast index 73eede2c6..0811e2a9e 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast @@ -77,12 +77,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 0) @@ -192,12 +191,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 0) @@ -368,12 +366,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) @@ -406,12 +403,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 1) -- cgit v1.2.3