From 9871e0eb8cdd7058f023a58ccd3cdf602c169732 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Mon, 15 Jun 2026 13:48:09 -0700 Subject: [PATCH] Tag `VMContRef` fields and continuation stack memory with alias regions --- crates/cranelift/src/alias_region.rs | 80 +++++-- .../stack_switching/instructions.rs | 146 ++++++++---- .../resume-suspend-data-passing.wat | 152 ++++++------ .../disas/stack-switching/resume-suspend.wat | 142 ++++++------ .../stack-switching/symmetric-switch.wat | 216 +++++++++--------- 5 files changed, 429 insertions(+), 307 deletions(-) diff --git a/crates/cranelift/src/alias_region.rs b/crates/cranelift/src/alias_region.rs index bb7638a36121..f932a7af1acb 100644 --- a/crates/cranelift/src/alias_region.rs +++ b/crates/cranelift/src/alias_region.rs @@ -24,6 +24,8 @@ enum VmType { VMDrcHeapData, VMCopyingHeapData, VMNullHeapData, + VMContRef, + ContinuationStackMemory, } /// A key that uniquely identifies an alias region across an entire compilation. @@ -85,7 +87,7 @@ enum AliasRegionKey { } impl AliasRegionKey { - const KIND_BITS: u32 = 4; + const KIND_BITS: u32 = 5; const KIND_OFFSET: u32 = 32 - Self::KIND_BITS; const KIND_MASK: u32 = ((1 << Self::KIND_BITS) - 1) << Self::KIND_OFFSET; @@ -102,21 +104,23 @@ impl AliasRegionKey { kind << Self::KIND_OFFSET } - const VM_CONTEXT_KIND: u32 = Self::new_kind(0b0000); - const VM_STORE_CONTEXT_KIND: u32 = Self::new_kind(0b0001); - const IMPORTED_MEMORY_KIND: u32 = Self::new_kind(0b0010); - const DEFINED_MEMORY_KIND: u32 = Self::new_kind(0b0011); - const IMPORTED_TABLE_KIND: u32 = Self::new_kind(0b0100); - const DEFINED_TABLE_KIND: u32 = Self::new_kind(0b0101); - const IMPORTED_GLOBAL_KIND: u32 = Self::new_kind(0b0110); - const DEFINED_GLOBAL_KIND: u32 = Self::new_kind(0b0111); - const GC_HEAP_KIND: u32 = Self::new_kind(0b1000); - const VM_MEMORY_DEFINITION_KIND: u32 = Self::new_kind(0b1001); - const VM_TABLE_DEFINITION_KIND: u32 = Self::new_kind(0b1010); - const VM_COMPONENT_CONTEXT_KIND: u32 = Self::new_kind(0b1011); - const VM_DRC_HEAP_DATA_KIND: u32 = Self::new_kind(0b1100); - const VM_COPYING_HEAP_DATA_KIND: u32 = Self::new_kind(0b1101); - const VM_NULL_HEAP_DATA_KIND: u32 = Self::new_kind(0b1110); + const VM_CONTEXT_KIND: u32 = Self::new_kind(0b00000); + const VM_STORE_CONTEXT_KIND: u32 = Self::new_kind(0b00001); + const IMPORTED_MEMORY_KIND: u32 = Self::new_kind(0b00010); + const DEFINED_MEMORY_KIND: u32 = Self::new_kind(0b00011); + const IMPORTED_TABLE_KIND: u32 = Self::new_kind(0b00100); + const DEFINED_TABLE_KIND: u32 = Self::new_kind(0b00101); + const IMPORTED_GLOBAL_KIND: u32 = Self::new_kind(0b00110); + const DEFINED_GLOBAL_KIND: u32 = Self::new_kind(0b00111); + const GC_HEAP_KIND: u32 = Self::new_kind(0b01000); + const VM_MEMORY_DEFINITION_KIND: u32 = Self::new_kind(0b01001); + const VM_TABLE_DEFINITION_KIND: u32 = Self::new_kind(0b01010); + const VM_COMPONENT_CONTEXT_KIND: u32 = Self::new_kind(0b01011); + const VM_DRC_HEAP_DATA_KIND: u32 = Self::new_kind(0b01100); + const VM_COPYING_HEAP_DATA_KIND: u32 = Self::new_kind(0b01101); + const VM_NULL_HEAP_DATA_KIND: u32 = Self::new_kind(0b01110); + const VM_CONTREF_KIND: u32 = Self::new_kind(0b01111); + const CONTINUATION_STACK_MEMORY_KIND: u32 = Self::new_kind(0b10000); /// Encode this key into a raw `u32` suitable for use as an /// `AliasRegionData::user_id`. @@ -133,6 +137,8 @@ impl AliasRegionKey { VmType::VMDrcHeapData => Self::VM_DRC_HEAP_DATA_KIND, VmType::VMCopyingHeapData => Self::VM_COPYING_HEAP_DATA_KIND, VmType::VMNullHeapData => Self::VM_NULL_HEAP_DATA_KIND, + VmType::VMContRef => Self::VM_CONTREF_KIND, + VmType::ContinuationStackMemory => Self::CONTINUATION_STACK_MEMORY_KIND, }; kind | (offset & Self::OFFSET_MASK) } @@ -1886,3 +1892,45 @@ where ); } } + +/// Stack-switching and continuation-object methods. +impl AliasRegions +where + Offsets: GetPtrSize, +{ + /// Region for a continuation-reference object and its inline + /// sub-structures. + /// + /// A `VMContRef` (and its inline `VMCommonStackInformation` / + /// `VMStackLimits` / `VMHostArray` headers) is reached through a `*mut + /// VMContRef`. + /// + /// A single region covers the whole object: this is coarse but sound, and + /// keeps every field of the object disjoint from linear memory, the vmctx, + /// the store context, etc... + pub fn vmcontref_region(&mut self, func: &mut ir::Function) -> ir::AliasRegion { + self.region( + func, + AliasRegionKey::Vm { + ty: VmType::VMContRef, + offset: 0, + }, + ) + } + + /// Region for a continuation's stack memory: its payload/handler data + /// buffers and the control-context records stored on the continuation + /// stack. + /// + /// These are distinct from the `VMContRef` object itself (which only holds + /// pointers to them). + pub fn continuation_stack_memory_region(&mut self, func: &mut ir::Function) -> ir::AliasRegion { + self.region( + func, + AliasRegionKey::Vm { + ty: VmType::ContinuationStackMemory, + offset: 0, + }, + ) + } +} diff --git a/crates/cranelift/src/func_environ/stack_switching/instructions.rs b/crates/cranelift/src/func_environ/stack_switching/instructions.rs index 8432b7b416fd..a3dff164901f 100644 --- a/crates/cranelift/src/func_environ/stack_switching/instructions.rs +++ b/crates/cranelift/src/func_environ/stack_switching/instructions.rs @@ -137,8 +137,8 @@ pub(crate) mod stack_switching_helpers { new_stack_chain: &VMStackChain, ) { let offset = env.offsets.ptr.vmcontref_parent_chain().into(); - // TODO: tag with the `VMContRef` alias region. - new_stack_chain.store(env, builder, self.address, offset, None) + let region = env.alias_regions.vmcontref_region(builder.func); + new_stack_chain.store(env, builder, self.address, offset, Some(region)) } /// Loads the parent of this continuation, which may either be another @@ -150,8 +150,15 @@ pub(crate) mod stack_switching_helpers { builder: &mut FunctionBuilder, ) -> VMStackChain { let offset = env.offsets.ptr.vmcontref_parent_chain().into(); - // TODO: tag with the `VMContRef` alias region. - VMStackChain::load(env, builder, self.address, offset, env.pointer_type(), None) + let region = env.alias_regions.vmcontref_region(builder.func); + VMStackChain::load( + env, + builder, + self.address, + offset, + env.pointer_type(), + Some(region), + ) } pub fn set_last_ancestor<'a>( @@ -161,7 +168,8 @@ pub(crate) mod stack_switching_helpers { last_ancestor: ir::Value, ) { let offset: i32 = env.offsets.ptr.vmcontref_last_ancestor().into(); - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); builder .ins() .store(mem_flags, last_ancestor, self.address, offset); @@ -173,7 +181,8 @@ pub(crate) mod stack_switching_helpers { builder: &mut FunctionBuilder, ) -> ir::Value { let offset: i32 = env.offsets.ptr.vmcontref_last_ancestor().into(); - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); builder .ins() .load(env.pointer_type(), mem_flags, self.address, offset) @@ -186,7 +195,8 @@ pub(crate) mod stack_switching_helpers { env: &mut crate::func_environ::FuncEnvironment<'a>, builder: &mut FunctionBuilder, ) -> ir::Value { - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let offset: i32 = env.offsets.ptr.vmcontref_revision().into(); let revision = builder.ins().load(I64, mem_flags, self.address, offset); revision @@ -201,7 +211,8 @@ pub(crate) mod stack_switching_helpers { builder: &mut FunctionBuilder, revision: ir::Value, ) -> ir::Value { - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let offset: i32 = env.offsets.ptr.vmcontref_revision().into(); let revision_plus1 = builder.ins().iadd_imm_s(revision, 1); builder @@ -230,18 +241,32 @@ pub(crate) mod stack_switching_helpers { } } - fn get(&self, builder: &mut FunctionBuilder, ty: ir::Type, offset: i32) -> ir::Value { - let mem_flags = ir::MemFlagsData::trusted(); + fn get( + &self, + env: &mut crate::func_environ::FuncEnvironment<'_>, + builder: &mut FunctionBuilder, + ty: ir::Type, + offset: i32, + ) -> ir::Value { + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); builder.ins().load(ty, mem_flags, self.address, offset) } - fn set(&self, builder: &mut FunctionBuilder, offset: i32, value: ir::Value) { + fn set( + &self, + env: &mut crate::func_environ::FuncEnvironment<'_>, + builder: &mut FunctionBuilder, + offset: i32, + value: ir::Value, + ) { debug_assert_eq!( builder.func.dfg.value_type(value), Type::int_with_byte_size(u16::try_from(core::mem::size_of::()).unwrap()) .unwrap() ); - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); builder.ins().store(mem_flags, value, self.address, offset); } @@ -251,7 +276,8 @@ pub(crate) mod stack_switching_helpers { builder: &mut FunctionBuilder, ) -> ir::Value { let offset = env.offsets.ptr.vmhostarray_data().into(); - self.get(builder, env.pointer_type(), offset) + let pointer_type = env.pointer_type(); + self.get(env, builder, pointer_type, offset) } pub fn get_length<'a>( @@ -261,7 +287,7 @@ pub(crate) mod stack_switching_helpers { ) -> ir::Value { // Array length is stored as u32. let offset = env.offsets.ptr.vmhostarray_length().into(); - self.get(builder, I32, offset) + self.get(env, builder, I32, offset) } fn set_length<'a>( @@ -272,7 +298,7 @@ pub(crate) mod stack_switching_helpers { ) { // Array length is stored as u32. let offset = env.offsets.ptr.vmhostarray_length().into(); - self.set::(builder, offset, length); + self.set::(env, builder, offset, length); } fn set_capacity<'a>( @@ -283,7 +309,7 @@ pub(crate) mod stack_switching_helpers { ) { // Array capacity is stored as u32. let offset = env.offsets.ptr.vmhostarray_capacity().into(); - self.set::(builder, offset, capacity); + self.set::(env, builder, offset, capacity); } fn set_data<'a>( @@ -294,7 +320,8 @@ pub(crate) mod stack_switching_helpers { ) { debug_assert_eq!(builder.func.dfg.value_type(data), env.pointer_type()); let offset: i32 = env.offsets.ptr.vmhostarray_data().into(); - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); builder.ins().store(mem_flags, data, self.address, offset); } @@ -373,7 +400,10 @@ pub(crate) mod stack_switching_helpers { builder: &mut FunctionBuilder, load_types: &[ir::Type], ) -> Vec { - let memflags = ir::MemFlagsData::trusted(); + let region = env + .alias_regions + .continuation_stack_memory_region(builder.func); + let memflags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let data_start_pointer = self.get_data(env, builder); let mut values = vec![]; @@ -411,7 +441,10 @@ pub(crate) mod stack_switching_helpers { size <= entry_size })); - let memflags = ir::MemFlagsData::trusted(); + let region = env + .alias_regions + .continuation_stack_memory_region(builder.func); + let memflags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let data_start_pointer = self.get_data(env, builder); @@ -617,7 +650,8 @@ pub(crate) mod stack_switching_helpers { env: &mut crate::func_environ::FuncEnvironment<'a>, builder: &mut FunctionBuilder, ) -> ir::Value { - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let state_ptr = self.get_state_ptr(env, builder); builder.ins().load(I32, mem_flags, state_ptr, 0) @@ -630,7 +664,8 @@ pub(crate) mod stack_switching_helpers { discriminant: u32, ) { let discriminant = builder.ins().iconst(I32, i64::from(discriminant)); - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let state_ptr = self.get_state_ptr(env, builder); builder.ins().store(mem_flags, discriminant, state_ptr, 0); @@ -702,7 +737,8 @@ pub(crate) mod stack_switching_helpers { builder: &mut FunctionBuilder, ) -> ir::Value { // Field first_switch_handler_index has type u32 - let memflags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let memflags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let offset: i32 = env .offsets .ptr @@ -718,7 +754,8 @@ pub(crate) mod stack_switching_helpers { value: ir::Value, ) { // Field first_switch_handler_index has type u32 - let memflags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let memflags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let offset: i32 = env .offsets .ptr @@ -742,9 +779,12 @@ pub(crate) mod stack_switching_helpers { let stack_limit_offset = env.offsets.ptr.vmstack_limits_stack_limit(); let last_wasm_entry_fp_offset = env.offsets.ptr.vmstack_limits_last_wasm_entry_fp(); - // The load side reads this continuation's inline `VMStackLimits`; - // the store side targets the `VMStoreContext`. - let our_memflags = ir::MemFlagsData::trusted(); + // The load side reads this continuation's inline `VMStackLimits` + // (the `VMContRef` region); the store side targets the + // `VMStoreContext`. + let vmcontref_region = env.alias_regions.vmcontref_region(builder.func); + let our_memflags = + ir::MemFlagsData::trusted().with_alias_region(Some(vmcontref_region)); let stack_limit = builder.ins().load( pointer_type, @@ -790,10 +830,14 @@ pub(crate) mod stack_switching_helpers { let last_wasm_entry_fp = env .alias_regions .vmstore_context_last_wasm_entry_fp(&mut builder.cursor(), vmruntime_limits_ptr); + // ...and store to this continuation's inline `VMStackLimits`. + let vmcontref_region = env.alias_regions.vmcontref_region(builder.func); + let our_memflags = + ir::MemFlagsData::trusted().with_alias_region(Some(vmcontref_region)); let last_wasm_entry_fp_offset = env.offsets.ptr.vmstack_limits_last_wasm_entry_fp(); builder.ins().store( - ir::MemFlagsData::trusted(), + our_memflags, last_wasm_entry_fp, stack_limits_ptr, i32::from(last_wasm_entry_fp_offset), @@ -807,7 +851,7 @@ pub(crate) mod stack_switching_helpers { // ...and store to this continuation's inline `VMStackLimits`. let stack_limit_offset = env.offsets.ptr.vmstack_limits_stack_limit(); builder.ins().store( - ir::MemFlagsData::trusted(), + our_memflags, stack_limit, stack_limits_ptr, i32::from(stack_limit_offset), @@ -829,7 +873,8 @@ pub(crate) mod stack_switching_helpers { env: &mut crate::func_environ::FuncEnvironment<'a>, builder: &mut FunctionBuilder, ) -> ir::Value { - let mem_flags = ir::MemFlagsData::trusted(); + let region = env.alias_regions.vmcontref_region(builder.func); + let mem_flags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); builder .ins() .load(env.pointer_type(), mem_flags, self.tos_ptr, 0) @@ -909,7 +954,10 @@ pub(crate) fn vmcontref_store_payloads<'a>( let ptr = builder.block_params(store_data_block)[0]; // Store the values. - let memflags = ir::MemFlagsData::trusted(); + let region = env + .alias_regions + .continuation_stack_memory_region(builder.func); + let memflags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let mut offset = 0; for value in values { builder.ins().store(memflags, *value, ptr, offset); @@ -1138,7 +1186,10 @@ fn search_handler<'a>( let offset = builder.ins().uextend(I64, offset); let entry_address = builder.ins().iadd(base, offset); - let memflags = ir::MemFlagsData::trusted(); + let region = env + .alias_regions + .continuation_stack_memory_region(builder.func); + let memflags = ir::MemFlagsData::trusted().with_alias_region(Some(region)); let handled_tag = builder .ins() @@ -1869,26 +1920,37 @@ pub(crate) fn translate_switch<'a>( let slot = builder.create_sized_stack_slot(slot_size); let tmp_control_context = builder.ins().stack_addr(env.pointer_type(), slot, 0); - let flags = MemFlagsData::trusted(); + // The `*_last_ancestor_cc` control contexts live on continuation + // stacks, but the temporary lives in a current-frame stack slot, so + // only the former get the continuation-stack-memory region. + let region = env + .alias_regions + .continuation_stack_memory_region(builder.func); + let cc_flags = MemFlagsData::trusted().with_alias_region(Some(region)); + let tmp_flags = MemFlagsData::trusted(); let mut offset: i32 = 0; while offset < i32::from(cctx_size) { // switchee_last_ancestor_cc -> tmp control context - let tmp1 = - builder - .ins() - .load(env.pointer_type(), flags, switchee_last_ancestor_cc, offset); + let tmp1 = builder.ins().load( + env.pointer_type(), + cc_flags, + switchee_last_ancestor_cc, + offset, + ); builder .ins() - .store(flags, tmp1, tmp_control_context, offset); + .store(tmp_flags, tmp1, tmp_control_context, offset); // switcher_last_ancestor_cc -> switchee_last_ancestor_cc - let tmp2 = - builder - .ins() - .load(env.pointer_type(), flags, switcher_last_ancestor_cc, offset); + let tmp2 = builder.ins().load( + env.pointer_type(), + cc_flags, + switcher_last_ancestor_cc, + offset, + ); builder .ins() - .store(flags, tmp2, switchee_last_ancestor_cc, offset); + .store(cc_flags, tmp2, switchee_last_ancestor_cc, offset); offset += i32::try_from(env.pointer_type().bytes()).unwrap(); } diff --git a/tests/disas/stack-switching/resume-suspend-data-passing.wat b/tests/disas/stack-switching/resume-suspend-data-passing.wat index 2b6bab901080..b0424c4e6896 100644 --- a/tests/disas/stack-switching/resume-suspend-data-passing.wat +++ b/tests/disas/stack-switching/resume-suspend-data-passing.wat @@ -40,8 +40,10 @@ ;; function u0:0(i64 vmctx, i64) tail { ;; ss0 = explicit_slot 16, align = 65536 ;; region0 = 8 "VMContext+0x8" -;; region1 = 268435480 "VMStoreContext+0x18" -;; region2 = 268435544 "VMStoreContext+0x58" +;; region1 = 134217752 "VMStoreContext+0x18" +;; region2 = 134217816 "VMStoreContext+0x58" +;; region3 = 2013265920 "VMContRef+0x0" +;; region4 = 2147483648 "ContinuationStackMemory+0x0" ;; gv0 = vmctx ;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8 ;; gv2 = load.i64 notrap aligned region1 gv1+24 @@ -74,12 +76,12 @@ ;; @0044 jump block5 ;; ;; block5: -;; @0044 v14 = load.i64 notrap aligned v11+48 -;; @0044 v15 = load.i64 notrap aligned v11+56 +;; @0044 v14 = load.i64 notrap aligned region3 v11+48 +;; @0044 v15 = load.i64 notrap aligned region3 v11+56 ;; v73 = iconst.i64 24 ;; v74 = iadd v15, v73 ; v73 = 24 -;; @0044 v18 = load.i64 notrap aligned v74+8 -;; @0044 v19 = load.i32 notrap aligned v15+40 +;; @0044 v18 = load.i64 notrap aligned region3 v74+8 +;; @0044 v19 = load.i32 notrap aligned region3 v15+40 ;; v75 = iconst.i32 0 ;; v65 = iconst.i32 3 ;; @0044 v5 = iconst.i64 48 @@ -96,7 +98,7 @@ ;; v77 = ishl.i32 v21, v76 ; v76 = 3 ;; @0044 v25 = uextend.i64 v77 ;; @0044 v26 = iadd.i64 v18, v25 -;; @0044 v27 = load.i64 notrap aligned v26 +;; @0044 v27 = load.i64 notrap aligned region4 v26 ;; v78 = iadd.i64 v0, v5 ; v5 = 48 ;; v79 = icmp eq v27, v78 ;; v80 = iconst.i32 1 @@ -104,35 +106,35 @@ ;; @0044 brif v79, block8, block6(v81) ;; ;; block8: -;; @0044 store.i64 notrap aligned v11, v9+64 +;; @0044 store.i64 notrap aligned region3 v11, v9+64 ;; v82 = iconst.i32 1 ;; v83 = iconst.i64 120 ;; v84 = iadd.i64 v9, v83 ; v83 = 120 -;; @0044 store notrap aligned v82, v84+4 ; v82 = 1 -;; @0044 store.i64 notrap aligned v34, v84+8 -;; @0044 store.i32 notrap aligned v4, v34 -;; @0044 store notrap aligned v82, v84 ; v82 = 1 +;; @0044 store notrap aligned region3 v82, v84+4 ; v82 = 1 +;; @0044 store.i64 notrap aligned region3 v34, v84+8 +;; @0044 store.i32 notrap aligned region4 v4, v34 +;; @0044 store notrap aligned region3 v82, v84 ; v82 = 1 ;; v85 = iconst.i32 3 ;; v86 = iconst.i64 16 ;; v87 = iadd.i64 v9, v86 ; v86 = 16 -;; @0044 store notrap aligned v85, v87 ; v85 = 3 +;; @0044 store notrap aligned region3 v85, v87 ; v85 = 3 ;; v88 = iconst.i64 0 -;; @0044 store notrap aligned v88, v11+48 ; v88 = 0 -;; @0044 store notrap aligned v88, v11+56 ; v88 = 0 +;; @0044 store notrap aligned region3 v88, v11+48 ; v88 = 0 +;; @0044 store notrap aligned region3 v88, v11+56 ; v88 = 0 ;; v89 = iconst.i64 80 ;; v90 = iadd.i64 v11, v89 ; v89 = 80 -;; @0044 v51 = load.i64 notrap aligned v90 +;; @0044 v51 = load.i64 notrap aligned region3 v90 ;; v91 = iconst.i64 -24 ;; v92 = iadd v51, v91 ; v91 = -24 ;; @0044 v47 = uextend.i64 v21 ;; v93 = iconst.i64 0x0002_0000_0000 ;; v94 = bor v47, v93 ; v93 = 0x0002_0000_0000 ;; @0044 v54 = stack_switch v92, v92, v94 -;; @0044 v57 = load.i64 notrap aligned v84+8 +;; @0044 v57 = load.i64 notrap aligned region3 v84+8 ;; v95 = iconst.i32 0 -;; @0044 store notrap aligned v95, v84 ; v95 = 0 -;; @0044 store notrap aligned v95, v84+4 ; v95 = 0 -;; @0044 store notrap aligned v88, v84+8 ; v88 = 0 +;; @0044 store notrap aligned region3 v95, v84 ; v95 = 0 +;; @0044 store notrap aligned region3 v95, v84+4 ; v95 = 0 +;; @0044 store notrap aligned region3 v88, v84+8 ; v88 = 0 ;; v96 = isub.i32 v62, v82 ; v82 = 1 ;; @004d brif v96, block2(v96), block10 ;; @@ -149,9 +151,11 @@ ;; function u0:1(i64 vmctx, i64) tail { ;; ss0 = explicit_slot 8, align = 256 ;; region0 = 8 "VMContext+0x8" -;; region1 = 268435480 "VMStoreContext+0x18" -;; region2 = 268435544 "VMStoreContext+0x58" -;; region3 = 268435528 "VMStoreContext+0x48" +;; region1 = 134217752 "VMStoreContext+0x18" +;; region2 = 2013265920 "VMContRef+0x0" +;; region3 = 134217816 "VMStoreContext+0x58" +;; region4 = 134217800 "VMStoreContext+0x48" +;; region5 = 2147483648 "ContinuationStackMemory+0x0" ;; gv0 = vmctx ;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8 ;; gv2 = load.i64 notrap aligned region1 gv1+24 @@ -166,7 +170,7 @@ ;; @0056 v3 = call fn0(v0, v2) ; v2 = 0 ;; @0058 trapz v3, user16 ;; @0058 v6 = call fn1(v0, v3, v2, v2) ; v2 = 0, v2 = 0 -;; @0058 v7 = load.i64 notrap aligned v6+72 +;; @0058 v7 = load.i64 notrap aligned region2 v6+72 ;; @0058 v9 = uextend.i128 v7 ;; @0058 v10 = iconst.i64 64 ;; v115 = ishl v9, v10 ; v10 = 64 @@ -195,7 +199,7 @@ ;; block5: ;; @0062 v15 = ireduce.i64 v14 ;; @0062 trapz v15, user16 -;; @0062 v20 = load.i64 notrap aligned v15+72 +;; @0062 v20 = load.i64 notrap aligned region2 v15+72 ;; v122 = iconst.i64 64 ;; v123 = ushr.i128 v14, v122 ; v122 = 64 ;; @0062 v19 = ireduce.i64 v123 @@ -203,69 +207,69 @@ ;; @0062 trapz v21, user23 ;; v124 = iconst.i64 1 ;; v125 = iadd v20, v124 ; v124 = 1 -;; @0062 store notrap aligned v125, v15+72 -;; @0062 v24 = load.i64 notrap aligned v15+64 -;; @0062 v26 = load.i64 notrap aligned region2 v25+88 -;; @0062 v27 = load.i64 notrap aligned region2 v25+96 -;; @0062 store notrap aligned v26, v24+48 -;; @0062 store notrap aligned v27, v24+56 +;; @0062 store notrap aligned region2 v125, v15+72 +;; @0062 v24 = load.i64 notrap aligned region2 v15+64 +;; @0062 v26 = load.i64 notrap aligned region3 v25+88 +;; @0062 v27 = load.i64 notrap aligned region3 v25+96 +;; @0062 store notrap aligned region2 v26, v24+48 +;; @0062 store notrap aligned region2 v27, v24+56 ;; v126 = iconst.i64 0 -;; @0062 store notrap aligned v126, v15+64 ; v126 = 0 +;; @0062 store notrap aligned region2 v126, v15+64 ; v126 = 0 ;; v127 = iconst.i64 2 -;; @0062 store notrap aligned region2 v127, v25+88 ; v127 = 2 -;; @0062 store notrap aligned region2 v15, v25+96 +;; @0062 store notrap aligned region3 v127, v25+88 ; v127 = 2 +;; @0062 store notrap aligned region3 v15, v25+96 ;; v128 = iconst.i32 1 ;; v129 = iconst.i64 16 ;; v130 = iadd v15, v129 ; v129 = 16 -;; @0062 store notrap aligned v128, v130 ; v128 = 1 +;; @0062 store notrap aligned region2 v128, v130 ; v128 = 1 ;; v131 = iconst.i32 2 ;; v132 = iadd v27, v129 ; v129 = 16 -;; @0062 store notrap aligned v131, v132 ; v131 = 2 -;; @0062 v42 = load.i64 notrap aligned region3 v25+72 -;; @0062 store notrap aligned v42, v27+8 +;; @0062 store notrap aligned region2 v131, v132 ; v131 = 2 +;; @0062 v42 = load.i64 notrap aligned region4 v25+72 +;; @0062 store notrap aligned region2 v42, v27+8 ;; @0062 v43 = load.i64 notrap aligned region1 v25+24 -;; @0062 store notrap aligned v43, v27 -;; @0062 v46 = load.i64 notrap aligned v15 +;; @0062 store notrap aligned region2 v43, v27 +;; @0062 v46 = load.i64 notrap aligned region2 v15 ;; @0062 store notrap aligned region1 v46, v25+24 -;; @0062 v47 = load.i64 notrap aligned v15+8 -;; @0062 store notrap aligned region3 v47, v25+72 +;; @0062 v47 = load.i64 notrap aligned region2 v15+8 +;; @0062 store notrap aligned region4 v47, v25+72 ;; v133 = iconst.i64 24 ;; v134 = iadd v27, v133 ; v133 = 24 -;; @0062 store notrap aligned v128, v134+4 ; v128 = 1 -;; @0062 store.i64 notrap aligned v51, v134+8 +;; @0062 store notrap aligned region2 v128, v134+4 ; v128 = 1 +;; @0062 store.i64 notrap aligned region2 v51, v134+8 ;; v135 = iadd.i64 v0, v52 ; v52 = 48 -;; @0062 store notrap aligned v135, v51 -;; @0062 store notrap aligned v128, v134 ; v128 = 1 -;; @0062 store notrap aligned v128, v27+40 ; v128 = 1 +;; @0062 store notrap aligned region5 v135, v51 +;; @0062 store notrap aligned region2 v128, v134 ; v128 = 1 +;; @0062 store notrap aligned region2 v128, v27+40 ; v128 = 1 ;; v136 = iconst.i64 80 ;; v137 = iadd v24, v136 ; v136 = 80 -;; @0062 v62 = load.i64 notrap aligned v137 +;; @0062 v62 = load.i64 notrap aligned region2 v137 ;; v138 = iconst.i64 -24 ;; v139 = iadd v62, v138 ; v138 = -24 ;; v140 = iconst.i64 0x0001_0000_0000 ;; @0062 v65 = stack_switch v139, v139, v140 ; v140 = 0x0001_0000_0000 -;; @0062 v67 = load.i64 notrap aligned region2 v25+88 -;; @0062 v68 = load.i64 notrap aligned region2 v25+96 -;; @0062 store notrap aligned region2 v26, v25+88 -;; @0062 store notrap aligned region2 v27, v25+96 -;; @0062 store notrap aligned v128, v132 ; v128 = 1 +;; @0062 v67 = load.i64 notrap aligned region3 v25+88 +;; @0062 v68 = load.i64 notrap aligned region3 v25+96 +;; @0062 store notrap aligned region3 v26, v25+88 +;; @0062 store notrap aligned region3 v27, v25+96 +;; @0062 store notrap aligned region2 v128, v132 ; v128 = 1 ;; v141 = iconst.i32 0 -;; @0062 store notrap aligned v141, v134 ; v141 = 0 -;; @0062 store notrap aligned v141, v134+4 ; v141 = 0 -;; @0062 store notrap aligned v126, v134+8 ; v126 = 0 -;; @0062 store notrap aligned v126, v27+40 ; v126 = 0 +;; @0062 store notrap aligned region2 v141, v134 ; v141 = 0 +;; @0062 store notrap aligned region2 v141, v134+4 ; v141 = 0 +;; @0062 store notrap aligned region2 v126, v134+8 ; v126 = 0 +;; @0062 store notrap aligned region2 v126, v27+40 ; v126 = 0 ;; v142 = iconst.i64 32 ;; v143 = ushr v65, v142 ; v142 = 32 ;; @0062 brif v143, block7, block6 ;; ;; block7: -;; @0062 v82 = load.i64 notrap aligned region3 v25+72 -;; @0062 store notrap aligned v82, v68+8 -;; @0062 v85 = load.i64 notrap aligned v27 +;; @0062 v82 = load.i64 notrap aligned region4 v25+72 +;; @0062 store notrap aligned region2 v82, v68+8 +;; @0062 v85 = load.i64 notrap aligned region2 v27 ;; @0062 store notrap aligned region1 v85, v25+24 -;; @0062 v86 = load.i64 notrap aligned v27+8 -;; @0062 store notrap aligned region3 v86, v25+72 -;; @0062 v88 = load.i64 notrap aligned v68+72 +;; @0062 v86 = load.i64 notrap aligned region2 v27+8 +;; @0062 store notrap aligned region4 v86, v25+72 +;; @0062 v88 = load.i64 notrap aligned region2 v68+72 ;; @0062 jump block8 ;; ;; block9 cold: @@ -274,10 +278,10 @@ ;; block10: ;; @0062 v95 = iconst.i64 120 ;; @0062 v96 = iadd.i64 v68, v95 ; v95 = 120 -;; @0062 v97 = load.i64 notrap aligned v96+8 -;; @0062 v98 = load.i32 notrap aligned v97 +;; @0062 v97 = load.i64 notrap aligned region2 v96+8 +;; @0062 v98 = load.i32 notrap aligned region5 v97 ;; v148 = iconst.i32 0 -;; @0062 store notrap aligned v148, v96 ; v148 = 0 +;; @0062 store notrap aligned region2 v148, v96 ; v148 = 0 ;; @0062 jump block4 ;; ;; block8: @@ -285,22 +289,22 @@ ;; @0062 br_table v87, block9, [block10] ;; ;; block6: -;; @0062 v102 = load.i64 notrap aligned v27 +;; @0062 v102 = load.i64 notrap aligned region2 v27 ;; @0062 store notrap aligned region1 v102, v25+24 -;; @0062 v103 = load.i64 notrap aligned v27+8 -;; @0062 store notrap aligned region3 v103, v25+72 +;; @0062 v103 = load.i64 notrap aligned region2 v27+8 +;; @0062 store notrap aligned region4 v103, v25+72 ;; @0062 v106 = iconst.i32 4 ;; v144 = iconst.i64 16 ;; v145 = iadd.i64 v68, v144 ; v144 = 16 -;; @0062 store notrap aligned v106, v145 ; v106 = 4 +;; @0062 store notrap aligned region2 v106, v145 ; v106 = 4 ;; @0062 v109 = iconst.i64 104 ;; @0062 v110 = iadd.i64 v68, v109 ; v109 = 104 -;; @0062 v111 = load.i64 notrap aligned v110+8 +;; @0062 v111 = load.i64 notrap aligned region2 v110+8 ;; v146 = iconst.i32 0 -;; @0062 store notrap aligned v146, v110 ; v146 = 0 -;; @0062 store notrap aligned v146, v110+4 ; v146 = 0 +;; @0062 store notrap aligned region2 v146, v110 ; v146 = 0 +;; @0062 store notrap aligned region2 v146, v110+4 ; v146 = 0 ;; v147 = iconst.i64 0 -;; @0062 store notrap aligned v147, v110+8 ; v147 = 0 +;; @0062 store notrap aligned region2 v147, v110+8 ; v147 = 0 ;; @0068 return ;; ;; block4: diff --git a/tests/disas/stack-switching/resume-suspend.wat b/tests/disas/stack-switching/resume-suspend.wat index c5eee27179b7..8ec03f14bcc6 100644 --- a/tests/disas/stack-switching/resume-suspend.wat +++ b/tests/disas/stack-switching/resume-suspend.wat @@ -24,8 +24,10 @@ ;; function u0:0(i64 vmctx, i64) tail { ;; region0 = 8 "VMContext+0x8" -;; region1 = 268435480 "VMStoreContext+0x18" -;; region2 = 268435544 "VMStoreContext+0x58" +;; region1 = 134217752 "VMStoreContext+0x18" +;; region2 = 134217816 "VMStoreContext+0x58" +;; region3 = 2013265920 "VMContRef+0x0" +;; region4 = 2147483648 "ContinuationStackMemory+0x0" ;; gv0 = vmctx ;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8 ;; gv2 = load.i64 notrap aligned region1 gv1+24 @@ -47,12 +49,12 @@ ;; @003b jump block3 ;; ;; block3: -;; @003b v11 = load.i64 notrap aligned v8+48 -;; @003b v12 = load.i64 notrap aligned v8+56 +;; @003b v11 = load.i64 notrap aligned region3 v8+48 +;; @003b v12 = load.i64 notrap aligned region3 v8+56 ;; v62 = iconst.i64 24 ;; v63 = iadd v12, v62 ; v62 = 24 -;; @003b v15 = load.i64 notrap aligned v63+8 -;; @003b v16 = load.i32 notrap aligned v12+40 +;; @003b v15 = load.i64 notrap aligned region3 v63+8 +;; @003b v16 = load.i32 notrap aligned region3 v12+40 ;; v64 = iconst.i32 0 ;; v54 = iconst.i32 3 ;; @003b v2 = iconst.i64 48 @@ -69,7 +71,7 @@ ;; v66 = ishl.i32 v18, v65 ; v65 = 3 ;; @003b v22 = uextend.i64 v66 ;; @003b v23 = iadd.i64 v15, v22 -;; @003b v24 = load.i64 notrap aligned v23 +;; @003b v24 = load.i64 notrap aligned region4 v23 ;; v67 = iadd.i64 v0, v2 ; v2 = 48 ;; v68 = icmp eq v24, v67 ;; v69 = iconst.i32 1 @@ -77,17 +79,17 @@ ;; @003b brif v68, block6, block4(v70) ;; ;; block6: -;; @003b store.i64 notrap aligned v8, v6+64 +;; @003b store.i64 notrap aligned region3 v8, v6+64 ;; v71 = iconst.i32 3 ;; @003b v33 = iconst.i64 16 ;; @003b v34 = iadd.i64 v6, v33 ; v33 = 16 -;; @003b store notrap aligned v71, v34 ; v71 = 3 +;; @003b store notrap aligned region3 v71, v34 ; v71 = 3 ;; @003b v30 = iconst.i64 0 -;; @003b store notrap aligned v30, v8+48 ; v30 = 0 -;; @003b store notrap aligned v30, v8+56 ; v30 = 0 +;; @003b store notrap aligned region3 v30, v8+48 ; v30 = 0 +;; @003b store notrap aligned region3 v30, v8+56 ; v30 = 0 ;; @003b v42 = iconst.i64 80 ;; @003b v43 = iadd.i64 v8, v42 ; v42 = 80 -;; @003b v44 = load.i64 notrap aligned v43 +;; @003b v44 = load.i64 notrap aligned region3 v43 ;; @003b v45 = iconst.i64 -24 ;; @003b v46 = iadd v44, v45 ; v45 = -24 ;; @003b v40 = uextend.i64 v18 @@ -96,11 +98,11 @@ ;; @003b v47 = stack_switch v46, v46, v58 ;; @003b v28 = iconst.i64 120 ;; @003b v29 = iadd.i64 v6, v28 ; v28 = 120 -;; @003b v50 = load.i64 notrap aligned v29+8 +;; @003b v50 = load.i64 notrap aligned region3 v29+8 ;; v72 = iconst.i32 0 -;; @003b store notrap aligned v72, v29 ; v72 = 0 -;; @003b store notrap aligned v72, v29+4 ; v72 = 0 -;; @003b store notrap aligned v30, v29+8 ; v30 = 0 +;; @003b store notrap aligned region3 v72, v29 ; v72 = 0 +;; @003b store notrap aligned region3 v72, v29+4 ; v72 = 0 +;; @003b store notrap aligned region3 v30, v29+8 ; v30 = 0 ;; @003d jump block1 ;; ;; block1: @@ -110,9 +112,11 @@ ;; function u0:1(i64 vmctx, i64) tail { ;; ss0 = explicit_slot 8, align = 256 ;; region0 = 8 "VMContext+0x8" -;; region1 = 268435480 "VMStoreContext+0x18" -;; region2 = 268435544 "VMStoreContext+0x58" -;; region3 = 268435528 "VMStoreContext+0x48" +;; region1 = 134217752 "VMStoreContext+0x18" +;; region2 = 2013265920 "VMContRef+0x0" +;; region3 = 134217816 "VMStoreContext+0x58" +;; region4 = 134217800 "VMStoreContext+0x48" +;; region5 = 2147483648 "ContinuationStackMemory+0x0" ;; gv0 = vmctx ;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8 ;; gv2 = load.i64 notrap aligned region1 gv1+24 @@ -127,7 +131,7 @@ ;; @0043 v10 = call fn0(v0, v9) ; v9 = 0 ;; @0045 trapz v10, user16 ;; @0045 v13 = call fn1(v0, v10, v9, v9) ; v9 = 0, v9 = 0 -;; @0045 v14 = load.i64 notrap aligned v13+72 +;; @0045 v14 = load.i64 notrap aligned region2 v13+72 ;; @004e jump block3 ;; ;; block3: @@ -137,7 +141,7 @@ ;; v132 = ireduce.i64 v130 ;; v134 = bor v132, v13 ;; @004e trapz v134, user16 -;; @004e v26 = load.i64 notrap aligned v134+72 +;; @004e v26 = load.i64 notrap aligned region2 v134+72 ;; @0045 v15 = uextend.i128 v13 ;; @0045 v20 = bor v130, v15 ;; v136 = ushr v20, v5 ; v5 = 64 @@ -146,72 +150,72 @@ ;; @004e trapz v27, user23 ;; @004e v28 = iconst.i64 1 ;; @004e v29 = iadd v26, v28 ; v28 = 1 -;; @004e store notrap aligned v29, v134+72 -;; @004e v30 = load.i64 notrap aligned v134+64 +;; @004e store notrap aligned region2 v29, v134+72 +;; @004e v30 = load.i64 notrap aligned region2 v134+64 ;; @004e v31 = load.i64 notrap aligned readonly can_move region0 v0+8 -;; @004e v32 = load.i64 notrap aligned region2 v31+88 -;; @004e v33 = load.i64 notrap aligned region2 v31+96 -;; @004e store notrap aligned v32, v30+48 -;; @004e store notrap aligned v33, v30+56 +;; @004e v32 = load.i64 notrap aligned region3 v31+88 +;; @004e v33 = load.i64 notrap aligned region3 v31+96 +;; @004e store notrap aligned region2 v32, v30+48 +;; @004e store notrap aligned region2 v33, v30+56 ;; @0040 v2 = iconst.i64 0 -;; @004e store notrap aligned v2, v134+64 ; v2 = 0 +;; @004e store notrap aligned region2 v2, v134+64 ; v2 = 0 ;; @004e v35 = iconst.i64 2 -;; @004e store notrap aligned region2 v35, v31+88 ; v35 = 2 -;; @004e store notrap aligned region2 v134, v31+96 +;; @004e store notrap aligned region3 v35, v31+88 ; v35 = 2 +;; @004e store notrap aligned region3 v134, v31+96 ;; @004e v39 = iconst.i32 1 ;; @004e v40 = iconst.i64 16 ;; @004e v41 = iadd v134, v40 ; v40 = 16 -;; @004e store notrap aligned v39, v41 ; v39 = 1 +;; @004e store notrap aligned region2 v39, v41 ; v39 = 1 ;; @004e v42 = iconst.i32 2 ;; @004e v44 = iadd v33, v40 ; v40 = 16 -;; @004e store notrap aligned v42, v44 ; v42 = 2 -;; @004e v48 = load.i64 notrap aligned region3 v31+72 -;; @004e store notrap aligned v48, v33+8 +;; @004e store notrap aligned region2 v42, v44 ; v42 = 2 +;; @004e v48 = load.i64 notrap aligned region4 v31+72 +;; @004e store notrap aligned region2 v48, v33+8 ;; @004e v49 = load.i64 notrap aligned region1 v31+24 -;; @004e store notrap aligned v49, v33 -;; @004e v52 = load.i64 notrap aligned v134 +;; @004e store notrap aligned region2 v49, v33 +;; @004e v52 = load.i64 notrap aligned region2 v134 ;; @004e store notrap aligned region1 v52, v31+24 -;; @004e v53 = load.i64 notrap aligned v134+8 -;; @004e store notrap aligned region3 v53, v31+72 +;; @004e v53 = load.i64 notrap aligned region2 v134+8 +;; @004e store notrap aligned region4 v53, v31+72 ;; @004e v54 = iconst.i64 24 ;; @004e v55 = iadd v33, v54 ; v54 = 24 -;; @004e store notrap aligned v39, v55+4 ; v39 = 1 +;; @004e store notrap aligned region2 v39, v55+4 ; v39 = 1 ;; @004e v57 = stack_addr.i64 ss0 -;; @004e store notrap aligned v57, v55+8 +;; @004e store notrap aligned region2 v57, v55+8 ;; @004e v58 = iconst.i64 48 ;; @004e v59 = iadd.i64 v0, v58 ; v58 = 48 -;; @004e store notrap aligned v59, v57 -;; @004e store notrap aligned v39, v55 ; v39 = 1 -;; @004e store notrap aligned v39, v33+40 ; v39 = 1 +;; @004e store notrap aligned region5 v59, v57 +;; @004e store notrap aligned region2 v39, v55 ; v39 = 1 +;; @004e store notrap aligned region2 v39, v33+40 ; v39 = 1 ;; @004e v66 = iconst.i64 80 ;; @004e v67 = iadd v30, v66 ; v66 = 80 -;; @004e v68 = load.i64 notrap aligned v67 +;; @004e v68 = load.i64 notrap aligned region2 v67 ;; @004e v69 = iconst.i64 -24 ;; @004e v70 = iadd v68, v69 ; v69 = -24 ;; v138 = iconst.i64 0x0001_0000_0000 ;; @004e v71 = stack_switch v70, v70, v138 ; v138 = 0x0001_0000_0000 -;; @004e v73 = load.i64 notrap aligned region2 v31+88 -;; @004e v74 = load.i64 notrap aligned region2 v31+96 -;; @004e store notrap aligned region2 v32, v31+88 -;; @004e store notrap aligned region2 v33, v31+96 -;; @004e store notrap aligned v39, v44 ; v39 = 1 +;; @004e v73 = load.i64 notrap aligned region3 v31+88 +;; @004e v74 = load.i64 notrap aligned region3 v31+96 +;; @004e store notrap aligned region3 v32, v31+88 +;; @004e store notrap aligned region3 v33, v31+96 +;; @004e store notrap aligned region2 v39, v44 ; v39 = 1 ;; v141 = iconst.i32 0 -;; @004e store notrap aligned v141, v55 ; v141 = 0 -;; @004e store notrap aligned v141, v55+4 ; v141 = 0 -;; @004e store notrap aligned v2, v55+8 ; v2 = 0 -;; @004e store notrap aligned v2, v33+40 ; v2 = 0 +;; @004e store notrap aligned region2 v141, v55 ; v141 = 0 +;; @004e store notrap aligned region2 v141, v55+4 ; v141 = 0 +;; @004e store notrap aligned region2 v2, v55+8 ; v2 = 0 +;; @004e store notrap aligned region2 v2, v33+40 ; v2 = 0 ;; @004e v64 = iconst.i64 32 ;; @004e v83 = ushr v71, v64 ; v64 = 32 ;; @004e brif v83, block5, block4 ;; ;; block5: -;; @004e v88 = load.i64 notrap aligned region3 v31+72 -;; @004e store notrap aligned v88, v74+8 -;; @004e v91 = load.i64 notrap aligned v33 +;; @004e v88 = load.i64 notrap aligned region4 v31+72 +;; @004e store notrap aligned region2 v88, v74+8 +;; @004e v91 = load.i64 notrap aligned region2 v33 ;; @004e store notrap aligned region1 v91, v31+24 -;; @004e v92 = load.i64 notrap aligned v33+8 -;; @004e store notrap aligned region3 v92, v31+72 -;; @004e v94 = load.i64 notrap aligned v74+72 +;; @004e v92 = load.i64 notrap aligned region2 v33+8 +;; @004e store notrap aligned region4 v92, v31+72 +;; @004e v94 = load.i64 notrap aligned region2 v74+72 ;; @004e jump block6 ;; ;; block7 cold: @@ -220,9 +224,9 @@ ;; block8: ;; @004e v101 = iconst.i64 120 ;; @004e v102 = iadd.i64 v74, v101 ; v101 = 120 -;; @004e v103 = load.i64 notrap aligned v102+8 +;; @004e v103 = load.i64 notrap aligned region2 v102+8 ;; v149 = iconst.i32 0 -;; @004e store notrap aligned v149, v102 ; v149 = 0 +;; @004e store notrap aligned region2 v149, v102 ; v149 = 0 ;; @004e v96 = uextend.i128 v94 ;; v150 = iconst.i64 64 ;; v151 = ishl v96, v150 ; v150 = 64 @@ -235,22 +239,22 @@ ;; @004e br_table v93, block7, [block8] ;; ;; block4: -;; @004e v107 = load.i64 notrap aligned v33 +;; @004e v107 = load.i64 notrap aligned region2 v33 ;; @004e store notrap aligned region1 v107, v31+24 -;; @004e v108 = load.i64 notrap aligned v33+8 -;; @004e store notrap aligned region3 v108, v31+72 +;; @004e v108 = load.i64 notrap aligned region2 v33+8 +;; @004e store notrap aligned region4 v108, v31+72 ;; @004e v111 = iconst.i32 4 ;; v142 = iconst.i64 16 ;; v143 = iadd.i64 v74, v142 ; v142 = 16 -;; @004e store notrap aligned v111, v143 ; v111 = 4 +;; @004e store notrap aligned region2 v111, v143 ; v111 = 4 ;; @004e v114 = iconst.i64 104 ;; @004e v115 = iadd.i64 v74, v114 ; v114 = 104 -;; @004e v116 = load.i64 notrap aligned v115+8 +;; @004e v116 = load.i64 notrap aligned region2 v115+8 ;; v144 = iconst.i32 0 -;; @004e store notrap aligned v144, v115 ; v144 = 0 -;; @004e store notrap aligned v144, v115+4 ; v144 = 0 +;; @004e store notrap aligned region2 v144, v115 ; v144 = 0 +;; @004e store notrap aligned region2 v144, v115+4 ; v144 = 0 ;; v145 = iconst.i64 0 -;; @004e store notrap aligned v145, v115+8 ; v145 = 0 +;; @004e store notrap aligned region2 v145, v115+8 ; v145 = 0 ;; v146 = uextend.i128 v145 ; v145 = 0 ;; v147 = iconst.i64 64 ;; v148 = ishl v146, v147 ; v147 = 64 diff --git a/tests/disas/stack-switching/symmetric-switch.wat b/tests/disas/stack-switching/symmetric-switch.wat index 06d2b6e58523..9abc8e9292a8 100644 --- a/tests/disas/stack-switching/symmetric-switch.wat +++ b/tests/disas/stack-switching/symmetric-switch.wat @@ -28,9 +28,11 @@ ;; function u0:0(i64 vmctx, i64) tail { ;; ss0 = explicit_slot 24, align = 256 ;; region0 = 8 "VMContext+0x8" -;; region1 = 268435480 "VMStoreContext+0x18" -;; region2 = 268435544 "VMStoreContext+0x58" -;; region3 = 268435528 "VMStoreContext+0x48" +;; region1 = 134217752 "VMStoreContext+0x18" +;; region2 = 2013265920 "VMContRef+0x0" +;; region3 = 134217816 "VMStoreContext+0x58" +;; region4 = 2147483648 "ContinuationStackMemory+0x0" +;; region5 = 134217800 "VMStoreContext+0x48" ;; gv0 = vmctx ;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8 ;; gv2 = load.i64 notrap aligned region1 gv1+24 @@ -47,7 +49,7 @@ ;; @003c v4 = iconst.i32 1 ;; @003c v5 = iconst.i32 0 ;; @003c v6 = call fn1(v0, v3, v4, v5) ; v4 = 1, v5 = 0 -;; @003c v7 = load.i64 notrap aligned v6+72 +;; @003c v7 = load.i64 notrap aligned region2 v6+72 ;; @003c v8 = uextend.i128 v6 ;; @003c v9 = uextend.i128 v7 ;; @003c v10 = iconst.i64 64 @@ -60,17 +62,17 @@ ;; @003e v17 = ushr v13, v16 ;; @003e v18 = ireduce.i64 v17 ;; @003e trapz v14, user16 -;; @003e v19 = load.i64 notrap aligned v14+72 +;; @003e v19 = load.i64 notrap aligned region2 v14+72 ;; @003e v20 = icmp eq v19, v18 ;; @003e trapz v20, user23 ;; @003e v21 = iconst.i64 1 ;; @003e v22 = iadd v19, v21 ; v21 = 1 -;; @003e store notrap aligned v22, v14+72 +;; @003e store notrap aligned region2 v22, v14+72 ;; @003e v23 = iconst.i64 48 ;; @003e v24 = iadd v0, v23 ; v23 = 48 ;; @003e v25 = load.i64 notrap aligned readonly can_move region0 v0+8 -;; @003e v26 = load.i64 notrap aligned region2 v25+88 -;; @003e v27 = load.i64 notrap aligned region2 v25+96 +;; @003e v26 = load.i64 notrap aligned region3 v25+88 +;; @003e v27 = load.i64 notrap aligned region3 v25+96 ;; @003e jump block2(v26, v27) ;; ;; block2(v28: i64, v29: i64): @@ -79,13 +81,13 @@ ;; @003e brif v31, block7, block3 ;; ;; block3: -;; @003e v32 = load.i64 notrap aligned v29+48 -;; @003e v33 = load.i64 notrap aligned v29+56 +;; @003e v32 = load.i64 notrap aligned region2 v29+48 +;; @003e v33 = load.i64 notrap aligned region2 v29+56 ;; @003e v34 = iconst.i64 24 ;; @003e v35 = iadd v33, v34 ; v34 = 24 -;; @003e v36 = load.i64 notrap aligned v35+8 -;; @003e v37 = load.i32 notrap aligned v33+40 -;; @003e v38 = load.i32 notrap aligned v35 +;; @003e v36 = load.i64 notrap aligned region2 v35+8 +;; @003e v37 = load.i32 notrap aligned region2 v33+40 +;; @003e v38 = load.i32 notrap aligned region2 v35 ;; @003e jump block4(v37) ;; ;; block4(v39: i32): @@ -97,7 +99,7 @@ ;; @003e v42 = imul.i32 v39, v41 ; v41 = 8 ;; @003e v43 = uextend.i64 v42 ;; @003e v44 = iadd.i64 v36, v43 -;; @003e v45 = load.i64 notrap aligned v44 +;; @003e v45 = load.i64 notrap aligned region4 v44 ;; @003e v46 = icmp eq v45, v24 ;; @003e v47 = iconst.i32 1 ;; @003e v48 = iadd.i32 v39, v47 ; v47 = 1 @@ -107,7 +109,7 @@ ;; @003e trap user22 ;; ;; block6: -;; @003e store.i64 notrap aligned v29, v27+64 +;; @003e store.i64 notrap aligned region2 v29, v27+64 ;; @003e v49 = iconst.i64 120 ;; @003e v50 = iadd.i64 v27, v49 ; v49 = 120 ;; @003e v51 = iconst.i64 0 @@ -115,17 +117,17 @@ ;; @003e v53 = iconst.i32 3 ;; @003e v54 = iconst.i64 16 ;; @003e v55 = iadd v52, v54 ; v54 = 16 -;; @003e store notrap aligned v53, v55 ; v53 = 3 +;; @003e store notrap aligned region2 v53, v55 ; v53 = 3 ;; @003e v56 = iconst.i64 0 ;; @003e v57 = iconst.i64 0 -;; @003e store notrap aligned v56, v29+48 ; v56 = 0 -;; @003e store notrap aligned v57, v29+56 ; v57 = 0 +;; @003e store notrap aligned region2 v56, v29+48 ; v56 = 0 +;; @003e store notrap aligned region2 v57, v29+56 ; v57 = 0 ;; @003e v58 = load.i64 notrap aligned readonly can_move region0 v0+8 ;; @003e v59 = iconst.i64 0 ;; @003e v60 = iadd v52, v59 ; v59 = 0 -;; @003e v61 = load.i64 notrap aligned region3 v58+72 -;; @003e store notrap aligned v61, v60+8 -;; @003e v62 = load.i64 notrap aligned v27+72 +;; @003e v61 = load.i64 notrap aligned region5 v58+72 +;; @003e store notrap aligned region2 v61, v60+8 +;; @003e v62 = load.i64 notrap aligned region2 v27+72 ;; @003e v63 = uextend.i128 v27 ;; @003e v64 = uextend.i128 v62 ;; @003e v65 = iconst.i64 64 @@ -136,7 +138,7 @@ ;; @003e v71 = iadd.i64 v14, v70 ; v70 = 0 ;; @003e v72 = iconst.i64 16 ;; @003e v73 = iadd v71, v72 ; v72 = 16 -;; @003e v74 = load.i32 notrap aligned v73 +;; @003e v74 = load.i32 notrap aligned region2 v73 ;; @003e v75 = iconst.i32 0 ;; @003e v76 = icmp ne v74, v75 ; v75 = 0 ;; @003e brif v76, block9, block8 @@ -144,11 +146,11 @@ ;; block8: ;; @003e v77 = iconst.i64 104 ;; @003e v78 = iadd.i64 v14, v77 ; v77 = 104 -;; @003e v79 = load.i64 notrap aligned v78+8 -;; @003e v80 = load.i32 notrap aligned v78 +;; @003e v79 = load.i64 notrap aligned region2 v78+8 +;; @003e v80 = load.i32 notrap aligned region2 v78 ;; @003e v81 = iconst.i32 1 ;; @003e v82 = iadd v80, v81 ; v81 = 1 -;; @003e store notrap aligned v82, v78 +;; @003e store notrap aligned region2 v82, v78 ;; @003e v83 = uextend.i64 v80 ;; @003e v84 = iconst.i64 16 ;; @003e v85 = imul v83, v84 ; v84 = 16 @@ -158,11 +160,11 @@ ;; block9: ;; @003e v87 = iconst.i64 120 ;; @003e v88 = iadd.i64 v14, v87 ; v87 = 120 -;; @003e v89 = load.i64 notrap aligned v88+8 -;; @003e v90 = load.i32 notrap aligned v88 +;; @003e v89 = load.i64 notrap aligned region2 v88+8 +;; @003e v90 = load.i32 notrap aligned region2 v88 ;; @003e v91 = iconst.i32 1 ;; @003e v92 = iadd v90, v91 ; v91 = 1 -;; @003e store notrap aligned v92, v88 +;; @003e store notrap aligned region2 v92, v88 ;; @003e v93 = uextend.i64 v90 ;; @003e v94 = iconst.i64 16 ;; @003e v95 = imul v93, v94 ; v94 = 16 @@ -170,62 +172,62 @@ ;; @003e jump block10(v96) ;; ;; block10(v69: i64): -;; @003e store.i128 notrap aligned v68, v69 +;; @003e store.i128 notrap aligned region4 v68, v69 ;; @003e v97 = iconst.i64 0 ;; @003e v98 = iadd.i64 v14, v97 ; v97 = 0 ;; @003e v99 = iconst.i32 1 ;; @003e v100 = iconst.i64 16 ;; @003e v101 = iadd v98, v100 ; v100 = 16 -;; @003e store notrap aligned v99, v101 ; v99 = 1 -;; @003e v102 = load.i64 notrap aligned v14+64 -;; @003e store.i64 notrap aligned v32, v102+48 -;; @003e store.i64 notrap aligned v33, v102+56 +;; @003e store notrap aligned region2 v99, v101 ; v99 = 1 +;; @003e v102 = load.i64 notrap aligned region2 v14+64 +;; @003e store.i64 notrap aligned region2 v32, v102+48 +;; @003e store.i64 notrap aligned region2 v33, v102+56 ;; @003e v103 = iconst.i64 2 ;; @003e v104 = load.i64 notrap aligned readonly can_move region0 v0+8 -;; @003e store notrap aligned region2 v103, v104+88 ; v103 = 2 -;; @003e store.i64 notrap aligned region2 v14, v104+96 +;; @003e store notrap aligned region3 v103, v104+88 ; v103 = 2 +;; @003e store.i64 notrap aligned region3 v14, v104+96 ;; @003e v105 = iconst.i64 0 ;; @003e v106 = iadd v98, v105 ; v105 = 0 -;; @003e v107 = load.i64 notrap aligned v106 +;; @003e v107 = load.i64 notrap aligned region2 v106 ;; @003e store notrap aligned region1 v107, v58+24 -;; @003e v108 = load.i64 notrap aligned v106+8 -;; @003e store notrap aligned region3 v108, v58+72 +;; @003e v108 = load.i64 notrap aligned region2 v106+8 +;; @003e store notrap aligned region5 v108, v58+72 ;; @003e v109 = iconst.i64 80 ;; @003e v110 = iadd.i64 v29, v109 ; v109 = 80 -;; @003e v111 = load.i64 notrap aligned v110 +;; @003e v111 = load.i64 notrap aligned region2 v110 ;; @003e v112 = iconst.i64 -24 ;; @003e v113 = iadd v111, v112 ; v112 = -24 ;; @003e v114 = iconst.i64 80 ;; @003e v115 = iadd v102, v114 ; v114 = 80 -;; @003e v116 = load.i64 notrap aligned v115 +;; @003e v116 = load.i64 notrap aligned region2 v115 ;; @003e v117 = iconst.i64 -24 ;; @003e v118 = iadd v116, v117 ; v117 = -24 ;; @003e v119 = stack_addr.i64 ss0 -;; @003e v120 = load.i64 notrap aligned v118 +;; @003e v120 = load.i64 notrap aligned region4 v118 ;; @003e store notrap aligned v120, v119 -;; @003e v121 = load.i64 notrap aligned v113 -;; @003e store notrap aligned v121, v118 -;; @003e v122 = load.i64 notrap aligned v118+8 +;; @003e v121 = load.i64 notrap aligned region4 v113 +;; @003e store notrap aligned region4 v121, v118 +;; @003e v122 = load.i64 notrap aligned region4 v118+8 ;; @003e store notrap aligned v122, v119+8 -;; @003e v123 = load.i64 notrap aligned v113+8 -;; @003e store notrap aligned v123, v118+8 -;; @003e v124 = load.i64 notrap aligned v118+16 +;; @003e v123 = load.i64 notrap aligned region4 v113+8 +;; @003e store notrap aligned region4 v123, v118+8 +;; @003e v124 = load.i64 notrap aligned region4 v118+16 ;; @003e store notrap aligned v124, v119+16 -;; @003e v125 = load.i64 notrap aligned v113+16 -;; @003e store notrap aligned v125, v118+16 +;; @003e v125 = load.i64 notrap aligned region4 v113+16 +;; @003e store notrap aligned region4 v125, v118+16 ;; @003e v126 = iconst.i64 3 ;; @003e v127 = iconst.i64 32 ;; @003e v128 = ishl v126, v127 ; v126 = 3, v127 = 32 ;; @003e v129 = stack_switch v113, v119, v128 ;; @003e v130 = iconst.i64 120 ;; @003e v131 = iadd.i64 v27, v130 ; v130 = 120 -;; @003e v132 = load.i64 notrap aligned v131+8 +;; @003e v132 = load.i64 notrap aligned region2 v131+8 ;; @003e v133 = iconst.i32 0 -;; @003e store notrap aligned v133, v131 ; v133 = 0 +;; @003e store notrap aligned region2 v133, v131 ; v133 = 0 ;; @003e v134 = iconst.i32 0 -;; @003e store notrap aligned v134, v131+4 ; v134 = 0 +;; @003e store notrap aligned region2 v134, v131+4 ; v134 = 0 ;; @003e v135 = iconst.i64 0 -;; @003e store notrap aligned v135, v131+8 ; v135 = 0 +;; @003e store notrap aligned region2 v135, v131+8 ; v135 = 0 ;; @0041 jump block1 ;; ;; block1: @@ -234,7 +236,7 @@ ;; ;; function u0:1(i64 vmctx, i64, i128) tail { ;; region0 = 8 "VMContext+0x8" -;; region1 = 268435480 "VMStoreContext+0x18" +;; region1 = 134217752 "VMStoreContext+0x18" ;; gv0 = vmctx ;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8 ;; gv2 = load.i64 notrap aligned region1 gv1+24 @@ -250,9 +252,11 @@ ;; function u0:2(i64 vmctx, i64) tail { ;; ss0 = explicit_slot 8, align = 256 ;; region0 = 8 "VMContext+0x8" -;; region1 = 268435480 "VMStoreContext+0x18" -;; region2 = 268435544 "VMStoreContext+0x58" -;; region3 = 268435528 "VMStoreContext+0x48" +;; region1 = 134217752 "VMStoreContext+0x18" +;; region2 = 2013265920 "VMContRef+0x0" +;; region3 = 134217816 "VMStoreContext+0x58" +;; region4 = 134217800 "VMStoreContext+0x48" +;; region5 = 2147483648 "ContinuationStackMemory+0x0" ;; gv0 = vmctx ;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8 ;; gv2 = load.i64 notrap aligned region1 gv1+24 @@ -269,7 +273,7 @@ ;; @0049 v4 = iconst.i32 0 ;; @0049 v5 = iconst.i32 0 ;; @0049 v6 = call fn1(v0, v3, v4, v5) ; v4 = 0, v5 = 0 -;; @0049 v7 = load.i64 notrap aligned v6+72 +;; @0049 v7 = load.i64 notrap aligned region2 v6+72 ;; @0049 v8 = uextend.i128 v6 ;; @0049 v9 = uextend.i128 v7 ;; @0049 v10 = iconst.i64 64 @@ -285,87 +289,87 @@ ;; @004b v17 = ushr.i128 v13, v16 ;; @004b v18 = ireduce.i64 v17 ;; @004b trapz v14, user16 -;; @004b v19 = load.i64 notrap aligned v14+72 +;; @004b v19 = load.i64 notrap aligned region2 v14+72 ;; @004b v20 = icmp eq v19, v18 ;; @004b trapz v20, user23 ;; @004b v21 = iconst.i64 1 ;; @004b v22 = iadd v19, v21 ; v21 = 1 -;; @004b store notrap aligned v22, v14+72 -;; @004b v23 = load.i64 notrap aligned v14+64 +;; @004b store notrap aligned region2 v22, v14+72 +;; @004b v23 = load.i64 notrap aligned region2 v14+64 ;; @004b v24 = load.i64 notrap aligned readonly can_move region0 v0+8 -;; @004b v25 = load.i64 notrap aligned region2 v24+88 -;; @004b v26 = load.i64 notrap aligned region2 v24+96 -;; @004b store notrap aligned v25, v23+48 -;; @004b store notrap aligned v26, v23+56 +;; @004b v25 = load.i64 notrap aligned region3 v24+88 +;; @004b v26 = load.i64 notrap aligned region3 v24+96 +;; @004b store notrap aligned region2 v25, v23+48 +;; @004b store notrap aligned region2 v26, v23+56 ;; @004b v27 = iconst.i64 0 -;; @004b store notrap aligned v27, v14+64 ; v27 = 0 +;; @004b store notrap aligned region2 v27, v14+64 ; v27 = 0 ;; @004b v28 = iconst.i64 2 ;; @004b v29 = load.i64 notrap aligned readonly can_move region0 v0+8 -;; @004b store notrap aligned region2 v28, v29+88 ; v28 = 2 -;; @004b store notrap aligned region2 v14, v29+96 +;; @004b store notrap aligned region3 v28, v29+88 ; v28 = 2 +;; @004b store notrap aligned region3 v14, v29+96 ;; @004b v30 = iconst.i64 0 ;; @004b v31 = iadd v14, v30 ; v30 = 0 ;; @004b v32 = iconst.i32 1 ;; @004b v33 = iconst.i64 16 ;; @004b v34 = iadd v31, v33 ; v33 = 16 -;; @004b store notrap aligned v32, v34 ; v32 = 1 +;; @004b store notrap aligned region2 v32, v34 ; v32 = 1 ;; @004b v35 = iconst.i32 2 ;; @004b v36 = iconst.i64 16 ;; @004b v37 = iadd v26, v36 ; v36 = 16 -;; @004b store notrap aligned v35, v37 ; v35 = 2 +;; @004b store notrap aligned region2 v35, v37 ; v35 = 2 ;; @004b v38 = load.i64 notrap aligned readonly can_move region0 v0+8 ;; @004b v39 = iconst.i64 0 ;; @004b v40 = iadd v26, v39 ; v39 = 0 -;; @004b v41 = load.i64 notrap aligned region3 v38+72 -;; @004b store notrap aligned v41, v40+8 +;; @004b v41 = load.i64 notrap aligned region4 v38+72 +;; @004b store notrap aligned region2 v41, v40+8 ;; @004b v42 = load.i64 notrap aligned region1 v38+24 -;; @004b store notrap aligned v42, v40 +;; @004b store notrap aligned region2 v42, v40 ;; @004b v43 = iconst.i64 0 ;; @004b v44 = iadd v31, v43 ; v43 = 0 -;; @004b v45 = load.i64 notrap aligned v44 +;; @004b v45 = load.i64 notrap aligned region2 v44 ;; @004b store notrap aligned region1 v45, v38+24 -;; @004b v46 = load.i64 notrap aligned v44+8 -;; @004b store notrap aligned region3 v46, v38+72 +;; @004b v46 = load.i64 notrap aligned region2 v44+8 +;; @004b store notrap aligned region4 v46, v38+72 ;; @004b v47 = iconst.i64 24 ;; @004b v48 = iadd v26, v47 ; v47 = 24 ;; @004b v49 = iconst.i32 1 ;; @004b v50 = stack_addr.i64 ss0 -;; @004b store notrap aligned v49, v48+4 ; v49 = 1 -;; @004b store notrap aligned v50, v48+8 +;; @004b store notrap aligned region2 v49, v48+4 ; v49 = 1 +;; @004b store notrap aligned region2 v50, v48+8 ;; @004b v51 = iconst.i64 48 ;; @004b v52 = iadd.i64 v0, v51 ; v51 = 48 ;; @004b v53 = iconst.i32 1 -;; @004b v54 = load.i64 notrap aligned v48+8 -;; @004b store notrap aligned v52, v54 -;; @004b store notrap aligned v53, v48 ; v53 = 1 +;; @004b v54 = load.i64 notrap aligned region2 v48+8 +;; @004b store notrap aligned region5 v52, v54 +;; @004b store notrap aligned region2 v53, v48 ; v53 = 1 ;; @004b v55 = iconst.i32 0 -;; @004b store notrap aligned v55, v26+40 ; v55 = 0 +;; @004b store notrap aligned region2 v55, v26+40 ; v55 = 0 ;; @004b v56 = iconst.i64 1 ;; @004b v57 = iconst.i64 32 ;; @004b v58 = ishl v56, v57 ; v56 = 1, v57 = 32 ;; @004b v59 = iconst.i64 80 ;; @004b v60 = iadd v23, v59 ; v59 = 80 -;; @004b v61 = load.i64 notrap aligned v60 +;; @004b v61 = load.i64 notrap aligned region2 v60 ;; @004b v62 = iconst.i64 -24 ;; @004b v63 = iadd v61, v62 ; v62 = -24 ;; @004b v64 = stack_switch v63, v63, v58 ;; @004b v65 = load.i64 notrap aligned readonly can_move region0 v0+8 -;; @004b v66 = load.i64 notrap aligned region2 v65+88 -;; @004b v67 = load.i64 notrap aligned region2 v65+96 +;; @004b v66 = load.i64 notrap aligned region3 v65+88 +;; @004b v67 = load.i64 notrap aligned region3 v65+96 ;; @004b v68 = load.i64 notrap aligned readonly can_move region0 v0+8 -;; @004b store notrap aligned region2 v25, v68+88 -;; @004b store notrap aligned region2 v26, v68+96 +;; @004b store notrap aligned region3 v25, v68+88 +;; @004b store notrap aligned region3 v26, v68+96 ;; @004b v69 = iconst.i32 1 ;; @004b v70 = iconst.i64 16 ;; @004b v71 = iadd v26, v70 ; v70 = 16 -;; @004b store notrap aligned v69, v71 ; v69 = 1 +;; @004b store notrap aligned region2 v69, v71 ; v69 = 1 ;; @004b v72 = iconst.i32 0 -;; @004b store notrap aligned v72, v48 ; v72 = 0 +;; @004b store notrap aligned region2 v72, v48 ; v72 = 0 ;; @004b v73 = iconst.i32 0 -;; @004b store notrap aligned v73, v48+4 ; v73 = 0 +;; @004b store notrap aligned region2 v73, v48+4 ; v73 = 0 ;; @004b v74 = iconst.i64 0 -;; @004b store notrap aligned v74, v48+8 ; v74 = 0 -;; @004b store notrap aligned v27, v26+40 ; v27 = 0 +;; @004b store notrap aligned region2 v74, v48+8 ; v74 = 0 +;; @004b store notrap aligned region2 v27, v26+40 ; v27 = 0 ;; @004b v75 = iconst.i64 32 ;; @004b v76 = ushr v64, v75 ; v75 = 32 ;; @004b brif v76, block4, block3 @@ -375,16 +379,16 @@ ;; @004b v78 = iadd.i64 v67, v77 ; v77 = 0 ;; @004b v79 = iconst.i64 0 ;; @004b v80 = iadd v78, v79 ; v79 = 0 -;; @004b v81 = load.i64 notrap aligned region3 v38+72 -;; @004b store notrap aligned v81, v80+8 +;; @004b v81 = load.i64 notrap aligned region4 v38+72 +;; @004b store notrap aligned region2 v81, v80+8 ;; @004b v82 = iconst.i64 0 ;; @004b v83 = iadd.i64 v26, v82 ; v82 = 0 -;; @004b v84 = load.i64 notrap aligned v83 +;; @004b v84 = load.i64 notrap aligned region2 v83 ;; @004b store notrap aligned region1 v84, v38+24 -;; @004b v85 = load.i64 notrap aligned v83+8 -;; @004b store notrap aligned region3 v85, v38+72 +;; @004b v85 = load.i64 notrap aligned region2 v83+8 +;; @004b store notrap aligned region4 v85, v38+72 ;; @004b v86 = ireduce.i32 v64 -;; @004b v87 = load.i64 notrap aligned v67+72 +;; @004b v87 = load.i64 notrap aligned region2 v67+72 ;; @004b v88 = uextend.i128 v67 ;; @004b v89 = uextend.i128 v87 ;; @004b v90 = iconst.i64 64 @@ -402,25 +406,25 @@ ;; block3: ;; @004b v94 = iconst.i64 0 ;; @004b v95 = iadd.i64 v26, v94 ; v94 = 0 -;; @004b v96 = load.i64 notrap aligned v95 +;; @004b v96 = load.i64 notrap aligned region2 v95 ;; @004b store notrap aligned region1 v96, v38+24 -;; @004b v97 = load.i64 notrap aligned v95+8 -;; @004b store notrap aligned region3 v97, v38+72 +;; @004b v97 = load.i64 notrap aligned region2 v95+8 +;; @004b store notrap aligned region4 v97, v38+72 ;; @004b v98 = iconst.i64 0 ;; @004b v99 = iadd.i64 v67, v98 ; v98 = 0 ;; @004b v100 = iconst.i32 4 ;; @004b v101 = iconst.i64 16 ;; @004b v102 = iadd v99, v101 ; v101 = 16 -;; @004b store notrap aligned v100, v102 ; v100 = 4 +;; @004b store notrap aligned region2 v100, v102 ; v100 = 4 ;; @004b v103 = iconst.i64 104 ;; @004b v104 = iadd.i64 v67, v103 ; v103 = 104 -;; @004b v105 = load.i64 notrap aligned v104+8 +;; @004b v105 = load.i64 notrap aligned region2 v104+8 ;; @004b v106 = iconst.i32 0 -;; @004b store notrap aligned v106, v104 ; v106 = 0 +;; @004b store notrap aligned region2 v106, v104 ; v106 = 0 ;; @004b v107 = iconst.i32 0 -;; @004b store notrap aligned v107, v104+4 ; v107 = 0 +;; @004b store notrap aligned region2 v107, v104+4 ; v107 = 0 ;; @004b v108 = iconst.i64 0 -;; @004b store notrap aligned v108, v104+8 ; v108 = 0 +;; @004b store notrap aligned region2 v108, v104+8 ; v108 = 0 ;; @0050 jump block1 ;; ;; block1: