cfallin edited issue #1097:
@sunfishcode, we were discussing redundant SSA parameters. Here's a simple example. It's possible that the return block is a special case and that this is not what you were thinking about when you said redundant parameters should not occur.
Using the SpiderMonkey embedding here. Wat source:
(module (func (export "f") (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) (result i32) (i32.div_s (local.get 5) (local.get 1))))
IR code:
$ RUST_LOG=debug dist/bin/js --wasm-compiler=cranelift ~/moz/manyparam.js ... function u0:0(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 vmctx) -> i32 uext baldrdash { ebb0(v0: i32, v1: i32, v2: i32, v3: i32, v4: i32, v5: i32, v6: i32, v7: i32, v8: i32, v9: i32, v10: i64): @0041 v12 = sdiv v5, v1 @0042 jump ebb1(v12) ebb1(v11: i32): @0042 fallthrough_return v11 }
(Will look for additional examples.)
cfallin commented on issue #1097:
Renaming this to a slightly more general topic (remove redundant SSA parameters); this might be an interesting pass to have eventually. It looks like right now the specific case above -- the return arg -- is still generated. In general we don't have an invariant that we keep minimal SSA, so this is a potential enhancement rather than bug (to be explicitly clear about it); labeling as such.
Last updated: Dec 23 2024 at 13:07 UTC