From 49c45ac1675d787e7151f9beafcae479936aa9f3 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 14 Nov 2024 21:22:34 -0500 Subject: Use empty blocks instead of nops for empty scopes in IRBuilder (#7080) When IRBuilder builds an empty non-block scope such as a function body, an if arm, a try block, etc, it needs to produce some expression to represent the empty contents. Previously it produced a nop, but change it to produce an empty block instead. The binary writer and printer have special logic to elide empty blocks, so this produces smaller output. Update J2CLOpts to recognize functions containing empty blocks as trivial to avoid regressing one of its tests. --- test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast | 1 - 1 file changed, 1 deletion(-) (limited to 'test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast') diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast index 92dbe2bb2..2803d243d 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast @@ -114,7 +114,6 @@ (call $nothing) ) ;; CHECK: (func $nothing - ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $nothing ) -- cgit v1.2.3