diff options
author | Thomas Lively <tlively@google.com> | 2024-05-13 17:10:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-13 17:10:23 -0700 |
commit | 020d08e01ff506099c8293e69cd03f5f75f562d9 (patch) | |
tree | c61320e25d5945e9cd56a69d1fb013f867898951 /test/lit/binary/dwarf-multivalue.test | |
parent | 924533fbcd0181f4460a13adc5762ee52f97de58 (diff) | |
download | binaryen-020d08e01ff506099c8293e69cd03f5f75f562d9.tar.gz binaryen-020d08e01ff506099c8293e69cd03f5f75f562d9.tar.bz2 binaryen-020d08e01ff506099c8293e69cd03f5f75f562d9.zip |
Simplify scratch local calculation (#6583)
Change `countScratchLocals` to return the count and type of necessary scratch
locals. It used to encode them as keys in the global map from scratch local
types to local indices, which could not handle having more than one scratch
local of a given type and was generally harder to reason about due to its use of
global state. Take the opportunity to avoid emitting unnecessary scratch locals
for `TupleExtract` expressions that will be optimized to not use them.
Also simplify and better document the calculation of the mapping from IR indices
to binary indices for all locals, scratch and non-scratch.
Diffstat (limited to 'test/lit/binary/dwarf-multivalue.test')
-rw-r--r-- | test/lit/binary/dwarf-multivalue.test | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/lit/binary/dwarf-multivalue.test b/test/lit/binary/dwarf-multivalue.test index 435aebe25..c803dea14 100644 --- a/test/lit/binary/dwarf-multivalue.test +++ b/test/lit/binary/dwarf-multivalue.test @@ -75,12 +75,10 @@ ;; (local $11 i32) ;; Previous (local $11 (tuple i32 f32))'s first element ;; (local $12 f32) ;; Previous (local $11 (tuple i32 f32))'s second element ;; (local $13 i32) ;; Previous (local $12 i32) -;; (local $14 f32) ;; scratch local for f32 ;; We parse this binary again into Binaryen IR, roundtripping the original -;; binary. Here until (local $14) is the same with the previous list, and $15 is -;; is added for tuple parsing and $16 is added for stacky IR resolving during -;; binary reading process. +;; binary. Locals $14 and $15 are added for stacky IR resolving during binary +;; reading process. ;; RUN: wasm-opt -all -g --roundtrip %s.wasm -S -o - | filecheck %s --check-prefix=ROUNDTRIP ;; ROUNDTRIP: (func $test ;; ROUNDTRIP-NEXT: (local $0 i32) @@ -97,9 +95,8 @@ ;; ROUNDTRIP-NEXT: (local $11 i32) ;; ROUNDTRIP-NEXT: (local $12 f32) ;; ROUNDTRIP-NEXT: (local $13 i32) -;; ROUNDTRIP-NEXT: (local $14 f32) -;; ROUNDTRIP-NEXT: (local $15 (tuple i32 f32)) -;; ROUNDTRIP-NEXT: (local $16 i32) +;; ROUNDTRIP-NEXT: (local $14 (tuple i32 f32)) +;; ROUNDTRIP-NEXT: (local $15 i32) ;; We can see that we don't reorder the locals during the process and the ;; original list of locals, local $0~$10, is untouched, to NOT invalidate DWARF |