Missing opportunity for redundant set elimination
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- wasm
- Domain
- compilers
Research direction
Begin by reproducing the shown function and inspecting Binaryen's redundant set elimination (RSE) handling for assignments used in the same basic block. Confirm that generated WebAssembly changes from local.tee/local.get to the expected direct parameter use, then locate the relevant optimizer regression coverage and verify the expected output.
Written by the indexing model from the issue text.
Description
When variable used in basic block it could be also eliminated.
Simple example:
export function test(x: i32, y: i32): i32 {
x = y;
if (x) return x; // With "return y" RSE works as expected
return 0;
}
Current output:
(func $test (param $0 i32) (param $1 i32) (result i32)
local.get $1
local.tee $0
if
local.get $0
return
end
i32.const 0
)
expected output:
(func $test (param $0 i32) (param $1 i32) (result i32)
local.get $1
if
local.get $1
return
end
i32.const 0
)
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 77
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/binaryen
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
WebAssembly/binaryen#9135 · 1 comment ·
-
Difficulty 2/5 Half a day Newbie friendliness 76/100
WebAssembly/binaryen#9018 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/binaryen#9133 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WebAssembly/binaryen#9123 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/binaryen#9122 ·
All issues in WebAssembly/binaryen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eo#8923 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend Opencoarray
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
internal.h中,漏掉了1个定义。 Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100