Skip to content

Cranelift: look into removing redundant SSA parameters #1097

Description

@lars-t-hansen

@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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    craneliftIssues related to the Cranelift code generatorenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions