diff options
-rw-r--r-- | src/passes/Inlining.cpp | 19 | ||||
-rw-r--r-- | test/lit/passes/O4_disable-bulk-memory.wast | 6 | ||||
-rw-r--r-- | test/lit/passes/inlining-eh.wast | 4 | ||||
-rw-r--r-- | test/lit/passes/inlining-gc.wast | 2 | ||||
-rw-r--r-- | test/lit/passes/inlining-unreachable.wast | 4 | ||||
-rw-r--r-- | test/lit/passes/inlining_enable-tail-call.wast | 40 | ||||
-rw-r--r-- | test/lit/passes/inlining_memory64.wat | 2 | ||||
-rw-r--r-- | test/lit/passes/inlining_optimize-level=3.wast | 66 | ||||
-rw-r--r-- | test/lit/passes/inlining_splitting.wast | 118 | ||||
-rw-r--r-- | test/wasm2js/i64-ctz.2asm.js.opt | 4 | ||||
-rw-r--r-- | test/wasm2js/unary-ops.2asm.js.opt | 4 |
11 files changed, 141 insertions, 128 deletions
diff --git a/src/passes/Inlining.cpp b/src/passes/Inlining.cpp index 112c31036..28083f4d0 100644 --- a/src/passes/Inlining.cpp +++ b/src/passes/Inlining.cpp @@ -329,17 +329,27 @@ struct Updater : public PostWalker<Updater> { // Core inlining logic. Modifies the outside function (adding locals as // needed), and returns the inlined code. +// +// An optional name hint can be provided, which will then be used in the name of +// the block we put the inlined code in. Using a unique name hint in each call +// of this function can reduce the risk of name overlaps (which cause fixup work +// in UniqueNameMapper::uniquify). static Expression* doInlining(Module* module, Function* into, const InliningAction& action, - PassOptions& options) { + PassOptions& options, + Index nameHint = 0) { Function* from = action.contents; auto* call = (*action.callSite)->cast<Call>(); // Works for return_call, too Type retType = module->getFunction(call->target)->getResults(); Builder builder(*module); auto* block = builder.makeBlock(); - block->name = Name(std::string("__inlined_func$") + from->name.toString()); + auto name = std::string("__inlined_func$") + from->name.toString(); + if (nameHint) { + name += '$' + std::to_string(nameHint); + } + block->name = Name(name); // In the unlikely event that the function already has a branch target with // this name, fix that up, as otherwise we can get unexpected capture of our // branches, that is, we could end up with this: @@ -1084,7 +1094,7 @@ struct Inlining : public Pass { action.contents = getActuallyInlinedFunction(action.contents); // Perform the inlining and update counts. - doInlining(module, func, action, getPassOptions()); + doInlining(module, func, action, getPassOptions(), inlinedNameHint++); inlinedUses[inlinedName]++; inlinedInto.insert(func); assert(inlinedUses[inlinedName] <= infos[inlinedName].refs); @@ -1102,6 +1112,9 @@ struct Inlining : public Pass { }); } + // See explanation in doInlining() for the parameter nameHint. + Index inlinedNameHint = 0; + InliningMode getInliningMode(Name name) { auto& info = infos[name]; diff --git a/test/lit/passes/O4_disable-bulk-memory.wast b/test/lit/passes/O4_disable-bulk-memory.wast index 2d7f92299..89a172661 100644 --- a/test/lit/passes/O4_disable-bulk-memory.wast +++ b/test/lit/passes/O4_disable-bulk-memory.wast @@ -1386,8 +1386,8 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__inlined_func$~lib/internal/memory/memset - ;; CHECK-NEXT: (br_if $__inlined_func$~lib/internal/memory/memset + ;; CHECK-NEXT: (block $__inlined_func$~lib/internal/memory/memset$8 + ;; CHECK-NEXT: (br_if $__inlined_func$~lib/internal/memory/memset$8 ;; CHECK-NEXT: (i32.le_u ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 8) @@ -1426,7 +1426,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $__inlined_func$~lib/internal/memory/memset + ;; CHECK-NEXT: (br_if $__inlined_func$~lib/internal/memory/memset$8 ;; CHECK-NEXT: (i32.le_u ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 24) diff --git a/test/lit/passes/inlining-eh.wast b/test/lit/passes/inlining-eh.wast index cb5b1bda8..62cd400c0 100644 --- a/test/lit/passes/inlining-eh.wast +++ b/test/lit/passes/inlining-eh.wast @@ -90,7 +90,7 @@ ;; CHECK-NEXT: (delegate 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$callee-a (result i32) + ;; CHECK-NEXT: (block $__inlined_func$callee-a$1 (result i32) ;; CHECK-NEXT: (i32.const 42) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -119,7 +119,7 @@ ;; CHECK-NEXT: (pop i32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$callee-b + ;; CHECK-NEXT: (block $__inlined_func$callee-b$2 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/inlining-gc.wast b/test/lit/passes/inlining-gc.wast index 0dac4cc9a..31c643752 100644 --- a/test/lit/passes/inlining-gc.wast +++ b/test/lit/passes/inlining-gc.wast @@ -26,7 +26,7 @@ ;; CHECK: (func $caller-non-nullable (type $none_=>_none) ;; CHECK-NEXT: (local $0 (ref func)) - ;; CHECK-NEXT: (block $__inlined_func$target-non-nullable + ;; CHECK-NEXT: (block $__inlined_func$target-non-nullable$1 ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/inlining-unreachable.wast b/test/lit/passes/inlining-unreachable.wast index 66ed2097c..50d84fee3 100644 --- a/test/lit/passes/inlining-unreachable.wast +++ b/test/lit/passes/inlining-unreachable.wast @@ -31,7 +31,7 @@ ) ;; CHECK: (func $call-trap-result (type $none_=>_i32) (result i32) - ;; CHECK-NEXT: (block $__inlined_func$trap-result + ;; CHECK-NEXT: (block $__inlined_func$trap-result$1 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -49,7 +49,7 @@ (unreachable) ) ;; CHECK: (func $call-contents-then-trap (type $none_=>_none) - ;; CHECK-NEXT: (block $__inlined_func$contents-then-trap + ;; CHECK-NEXT: (block $__inlined_func$contents-then-trap$2 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (drop diff --git a/test/lit/passes/inlining_enable-tail-call.wast b/test/lit/passes/inlining_enable-tail-call.wast index 75a421142..d49c4d5e2 100644 --- a/test/lit/passes/inlining_enable-tail-call.wast +++ b/test/lit/passes/inlining_enable-tail-call.wast @@ -30,22 +30,22 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$tabled + ;; CHECK-NEXT: (block $__inlined_func$tabled$1 ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$multi + ;; CHECK-NEXT: (block $__inlined_func$multi$2 ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$multi0 + ;; CHECK-NEXT: (block $__inlined_func$multi$3 ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$ok + ;; CHECK-NEXT: (block $__inlined_func$ok$4 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -53,34 +53,34 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$int (result i32) + ;; CHECK-NEXT: (block $__inlined_func$int$5 (result i32) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result f64) - ;; CHECK-NEXT: (block $__inlined_func$double (result f64) + ;; CHECK-NEXT: (block $__inlined_func$double$6 (result f64) ;; CHECK-NEXT: (f64.const 3.14159) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$int2 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$int2$7 (result i32) ;; CHECK-NEXT: (i32.const 112) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $y ;; CHECK-NEXT: (block (result f64) - ;; CHECK-NEXT: (block $__inlined_func$double2 (result f64) + ;; CHECK-NEXT: (block $__inlined_func$double2$8 (result f64) ;; CHECK-NEXT: (f64.const 113.14159) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$with-local + ;; CHECK-NEXT: (block $__inlined_func$with-local$9 ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (f32.const 0) ;; CHECK-NEXT: ) @@ -90,7 +90,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$with-local2 + ;; CHECK-NEXT: (block $__inlined_func$with-local2$10 ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (i64.const 0) ;; CHECK-NEXT: ) @@ -101,18 +101,18 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$return (result i32) - ;; CHECK-NEXT: (br $__inlined_func$return + ;; CHECK-NEXT: (block $__inlined_func$return$11 (result i32) + ;; CHECK-NEXT: (br $__inlined_func$return$11 ;; CHECK-NEXT: (i32.const 5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$multipass + ;; CHECK-NEXT: (block $__inlined_func$multipass$12 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$multipass2 + ;; CHECK-NEXT: (block $__inlined_func$multipass2$15 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 6) ;; CHECK-NEXT: ) @@ -122,7 +122,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$param + ;; CHECK-NEXT: (block $__inlined_func$param$13 ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (f32.const 12.34000015258789) ;; CHECK-NEXT: ) @@ -183,7 +183,7 @@ (nop) ) ;; CHECK: (func $cycle1 - ;; CHECK-NEXT: (block $__inlined_func$cycle2 + ;; CHECK-NEXT: (block $__inlined_func$cycle2$14 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (call $cycle1) ;; CHECK-NEXT: ) @@ -518,7 +518,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (br $__inlined_func$1 ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$2 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$2$1 (result i32) ;; CHECK-NEXT: (i32.const 42) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -549,7 +549,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$2 + ;; CHECK-NEXT: (block $__inlined_func$2$1 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 42) ;; CHECK-NEXT: ) @@ -669,7 +669,7 @@ ;; CHECK: (func $19 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$13 + ;; CHECK-NEXT: (block $__inlined_func$13$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$0) @@ -688,7 +688,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__inlined_func$13) + ;; CHECK-NEXT: (br $__inlined_func$13$1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/inlining_memory64.wat b/test/lit/passes/inlining_memory64.wat index 43e77785c..cbea8769f 100644 --- a/test/lit/passes/inlining_memory64.wat +++ b/test/lit/passes/inlining_memory64.wat @@ -25,7 +25,7 @@ ) ;; CHECK: (func $call-grow (result i64) - ;; CHECK-NEXT: (block $__inlined_func$grow (result i64) + ;; CHECK-NEXT: (block $__inlined_func$grow$1 (result i64) ;; CHECK-NEXT: (memory.grow ;; CHECK-NEXT: (i64.const 1) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/inlining_optimize-level=3.wast b/test/lit/passes/inlining_optimize-level=3.wast index 2fcdeef5c..27a8853ec 100644 --- a/test/lit/passes/inlining_optimize-level=3.wast +++ b/test/lit/passes/inlining_optimize-level=3.wast @@ -83,14 +83,14 @@ ;; CHECK: (func $intoHere ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$yes (result i32) + ;; CHECK-NEXT: (block $__inlined_func$yes$2 (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$yes-big-but-single-use (result i32) + ;; CHECK-NEXT: (block $__inlined_func$yes-big-but-single-use$3 (result i32) ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -136,9 +136,9 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$no-calls (result i32) + ;; CHECK-NEXT: (block $__inlined_func$no-calls$21 (result i32) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$yes0 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$yes (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -149,9 +149,9 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$no-calls0 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$no-calls$22 (result i32) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$yes1 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$yes0 (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -162,9 +162,9 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$yes-calls-but-one-use (result i32) + ;; CHECK-NEXT: (block $__inlined_func$yes-calls-but-one-use$23 (result i32) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$yes2 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$yes$1 (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -174,7 +174,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$no-loops (result i32) + ;; CHECK-NEXT: (block $__inlined_func$no-loops$4 (result i32) ;; CHECK-NEXT: (loop $loop-in (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -183,8 +183,8 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$no-loops0 (result i32) - ;; CHECK-NEXT: (loop $loop-in1 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$no-loops$5 (result i32) + ;; CHECK-NEXT: (loop $loop-in0 (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -192,8 +192,8 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$yes-loops-but-one-use (result i32) - ;; CHECK-NEXT: (loop $loop-in0 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$yes-loops-but-one-use$6 (result i32) + ;; CHECK-NEXT: (loop $loop-in1 (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -201,7 +201,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$no-loops-but-one-use-but-exported (result i32) + ;; CHECK-NEXT: (block $__inlined_func$no-loops-but-one-use-but-exported$7 (result i32) ;; CHECK-NEXT: (loop $loop-in2 (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -210,7 +210,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$no-loops-but-one-use-but-tabled (result i32) + ;; CHECK-NEXT: (block $__inlined_func$no-loops-but-one-use-but-tabled$8 (result i32) ;; CHECK-NEXT: (loop $loop-in3 (result i32) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -239,7 +239,7 @@ ;; CHECK: (func $recursive-inlining-1 (param $x i32) (result i32) ;; CHECK-NEXT: (local $1 i32) - ;; CHECK-NEXT: (block $__inlined_func$recursive-inlining-2 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$recursive-inlining-2$9 (result i32) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -276,27 +276,27 @@ ;; CHECK-NEXT: (local $3 i32) ;; CHECK-NEXT: (local $4 i32) ;; CHECK-NEXT: (local $5 i32) - ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-2 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-2$10 (result i32) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-20 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-2$24 (result i32) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-21 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-2$25 (result i32) ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-22 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-2$26 (result i32) ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-23 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$b-recursive-inlining-2$27 (result i32) ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) @@ -336,70 +336,70 @@ ;; CHECK: (func $call-many-getters ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter + ;; CHECK-NEXT: (block $__inlined_func$getter$11 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter0 + ;; CHECK-NEXT: (block $__inlined_func$getter$12 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter1 + ;; CHECK-NEXT: (block $__inlined_func$getter$13 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter2 + ;; CHECK-NEXT: (block $__inlined_func$getter$14 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter3 + ;; CHECK-NEXT: (block $__inlined_func$getter$15 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter4 + ;; CHECK-NEXT: (block $__inlined_func$getter$16 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter5 + ;; CHECK-NEXT: (block $__inlined_func$getter$17 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter6 + ;; CHECK-NEXT: (block $__inlined_func$getter$18 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter7 + ;; CHECK-NEXT: (block $__inlined_func$getter$19 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$getter8 + ;; CHECK-NEXT: (block $__inlined_func$getter$20 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -533,10 +533,10 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block $__inlined_func$C (result f32) + ;; CHECK-NEXT: (block $__inlined_func$C$2 (result f32) ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$D + ;; CHECK-NEXT: (block $__inlined_func$D$1 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/inlining_splitting.wast b/test/lit/passes/inlining_splitting.wast index d1bc934dc..d51812404 100644 --- a/test/lit/passes/inlining_splitting.wast +++ b/test/lit/passes/inlining_splitting.wast @@ -66,7 +66,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$maybe-work-hard0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$maybe-work-hard$1 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) @@ -81,7 +81,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$maybe-work-hard1 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$maybe-work-hard$2 ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) @@ -126,7 +126,7 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$just-if + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$just-if$3 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -139,7 +139,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$just-if0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$just-if$4 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) @@ -214,7 +214,7 @@ ;; CHECK: (func $call-nondefaultable-param (type $none_=>_none) ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 (ref $struct)) - ;; CHECK-NEXT: (block $__inlined_func$nondefaultable-param + ;; CHECK-NEXT: (block $__inlined_func$nondefaultable-param$5 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -224,7 +224,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (br $__inlined_func$nondefaultable-param) + ;; CHECK-NEXT: (br $__inlined_func$nondefaultable-param$5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -259,7 +259,7 @@ ;; CHECK-NEXT: (local $4 i32) ;; CHECK-NEXT: (local $5 f64) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$many-params + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$many-params$6 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i64.const 0) ;; CHECK-NEXT: ) @@ -282,7 +282,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$many-params0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$many-params$7 ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (i64.const 0) ;; CHECK-NEXT: ) @@ -333,7 +333,7 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-eqz + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-eqz$8 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -350,7 +350,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-eqz0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-eqz$9 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -386,7 +386,7 @@ ;; CHECK: (func $call-condition-global (type $none_=>_none) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-global + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-global$10 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) @@ -396,7 +396,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-global0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-global$11 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) @@ -429,7 +429,7 @@ ;; CHECK-NEXT: (local $0 anyref) ;; CHECK-NEXT: (local $1 anyref) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-ref.is + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-ref.is$12 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -446,7 +446,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-ref.is0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$condition-ref.is$13 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -575,7 +575,7 @@ ;; CHECK: (func $call-start-used-globally (type $none_=>_none) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$start-used-globally + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$start-used-globally$14 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) @@ -585,7 +585,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$start-used-globally0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$start-used-globally$15 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) @@ -612,18 +612,18 @@ ;; CHECK: (func $call-inlineable (type $none_=>_none) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$inlineable + ;; CHECK-NEXT: (block $__inlined_func$inlineable$16 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $glob) - ;; CHECK-NEXT: (br $__inlined_func$inlineable) + ;; CHECK-NEXT: (br $__inlined_func$inlineable$16) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$inlineable0 + ;; CHECK-NEXT: (block $__inlined_func$inlineable$17 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $glob) - ;; CHECK-NEXT: (br $__inlined_func$inlineable0) + ;; CHECK-NEXT: (br $__inlined_func$inlineable$17) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -760,7 +760,7 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$colliding-name + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$colliding-name$18 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -775,7 +775,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$colliding-name0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$colliding-name$19 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -830,7 +830,7 @@ ;; CHECK-NEXT: (local $1 anyref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$error-if-null (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$error-if-null$20 (result anyref) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -839,7 +839,7 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null$20 ;; CHECK-NEXT: (call $byn-split-outlined-B$error-if-null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -852,7 +852,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$error-if-null0 (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$error-if-null$21 (result anyref) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -861,7 +861,7 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null0 + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null$21 ;; CHECK-NEXT: (call $byn-split-outlined-B$error-if-null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -988,7 +988,7 @@ ;; CHECK-NEXT: (local $1 anyref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$reachable-if-body (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$reachable-if-body$22 (result anyref) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1008,7 +1008,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$reachable-if-body0 (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$reachable-if-body$23 (result anyref) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1048,7 +1048,7 @@ ;; CHECK-NEXT: (local $1 anyref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$reachable-if-body-noloop (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$reachable-if-body-noloop$24 (result anyref) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1066,7 +1066,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$reachable-if-body-noloop0 (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$reachable-if-body-noloop$25 (result anyref) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1158,7 +1158,7 @@ ;; CHECK-NEXT: (local $0 anyref) ;; CHECK-NEXT: (local $1 anyref) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$unreachable-if-body-no-result + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$unreachable-if-body-no-result$26 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1173,7 +1173,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$unreachable-if-body-no-result0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$unreachable-if-body-no-result$27 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1222,7 +1222,7 @@ ;; CHECK-NEXT: (local $3 anyref) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$multi-if (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$multi-if$28 (result anyref) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1231,7 +1231,7 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if + ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if$30 ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -1253,7 +1253,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result anyref) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$multi-if0 (result anyref) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$multi-if$29 (result anyref) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1262,7 +1262,7 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if$31 ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -1478,7 +1478,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$10 + ;; CHECK-NEXT: (block $__inlined_func$1$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (call $0) ;; CHECK-NEXT: ) @@ -1496,19 +1496,19 @@ ) ;; CHECK: (func $1 (type $none_=>_none) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$2 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-A$0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-A$0$3 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block $__inlined_func$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$00 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$4 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) @@ -1522,11 +1522,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$10 + ;; CHECK-NEXT: (block $__inlined_func$1$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$01 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$5 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) @@ -1663,7 +1663,7 @@ ;; CHECK-NEXT: (block $__inlined_func$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block -;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0 +;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$6 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) @@ -1676,10 +1676,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block -;; CHECK-NEXT: (block $__inlined_func$10 +;; CHECK-NEXT: (block $__inlined_func$1$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block -;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$00 +;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$7 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) @@ -1698,7 +1698,7 @@ ;; CHECK-NEXT: (block $__inlined_func$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block -;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0 +;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$8 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) @@ -1711,10 +1711,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block -;; CHECK-NEXT: (block $__inlined_func$10 +;; CHECK-NEXT: (block $__inlined_func$1$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block -;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$00 +;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$9 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) @@ -1737,7 +1737,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block -;; CHECK-NEXT: (block $__inlined_func$10 +;; CHECK-NEXT: (block $__inlined_func$1$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (call $0) ;; CHECK-NEXT: ) @@ -1812,14 +1812,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$middle-size-A0 + ;; CHECK-NEXT: (block $__inlined_func$middle-size-A$1 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (br $__inlined_func$middle-size-A0) + ;; CHECK-NEXT: (br $__inlined_func$middle-size-A$1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 0) @@ -1882,7 +1882,7 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$big-size-A + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$big-size-A$2 ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -1897,7 +1897,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$big-size-A0 + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$big-size-A$3 ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -1941,7 +1941,7 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$middle-size-B (result i32) + ;; CHECK-NEXT: (block $__inlined_func$middle-size-B$4 (result i32) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -1986,7 +1986,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$middle-size-B0 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$middle-size-B$5 (result i32) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -2065,14 +2065,14 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$big-size-B (result i32) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$big-size-B$6 (result i32) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B$6 ;; CHECK-NEXT: (call $byn-split-outlined-B$big-size-B ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -2085,14 +2085,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$big-size-B0 (result i32) + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-B$big-size-B$7 (result i32) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B0 + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B$7 ;; CHECK-NEXT: (call $byn-split-outlined-B$big-size-B ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) diff --git a/test/wasm2js/i64-ctz.2asm.js.opt b/test/wasm2js/i64-ctz.2asm.js.opt index 0d6ea794d..e3f1960b7 100644 --- a/test/wasm2js/i64-ctz.2asm.js.opt +++ b/test/wasm2js/i64-ctz.2asm.js.opt @@ -35,7 +35,7 @@ function asmFunc(imports) { function legalstub$ctz64($0, $1) { var $2 = 0, $3 = 0, $4 = 0, $5 = 0; - __inlined_func$__wasm_ctz_i64 : { + __inlined_func$__wasm_ctz_i64$1 : { if ($0 | $1) { $2 = $1 - 1 | 0; $3 = $2 + 1 | 0; @@ -47,7 +47,7 @@ function asmFunc(imports) { $1 = 63 - $0 | 0; i64toi32_i32$HIGH_BITS = 0 - ($0 >>> 0 > 63) | 0; $0 = $1; - break __inlined_func$__wasm_ctz_i64; + break __inlined_func$__wasm_ctz_i64$1; } i64toi32_i32$HIGH_BITS = 0; $0 = 64; diff --git a/test/wasm2js/unary-ops.2asm.js.opt b/test/wasm2js/unary-ops.2asm.js.opt index 76f3e1222..681891f81 100644 --- a/test/wasm2js/unary-ops.2asm.js.opt +++ b/test/wasm2js/unary-ops.2asm.js.opt @@ -79,7 +79,7 @@ function asmFunc(imports) { function legalstub$9($0, $1_1, $2, $3) { var $4 = 0, $5 = 0, $6_1 = 0, $7_1 = 0; - __inlined_func$__wasm_ctz_i64 : { + __inlined_func$__wasm_ctz_i64$3 : { if ($1_1 | $0) { $4 = $1_1 - 1 | 0; $5 = $4 + 1 | 0; @@ -90,7 +90,7 @@ function asmFunc(imports) { $0 = ($0 | 0) == 32 ? $7_1 : $0; $1_1 = 63 - $0 | 0; i64toi32_i32$HIGH_BITS = 0 - ($0 >>> 0 > 63) | 0; - break __inlined_func$__wasm_ctz_i64; + break __inlined_func$__wasm_ctz_i64$3; } i64toi32_i32$HIGH_BITS = 0; $1_1 = 64; |