Bug 272901
| Summary: | [WASM] Avoid extraneous move for simple integer arithmetic in BBQ | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Degazio <d_degazio> |
| Component: | WebAssembly | Assignee: | David Degazio <d_degazio> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | fujii, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=273048 | ||
David Degazio
When we emit various simple integer arithmetic instructions in BBQ with a constant operand, we currently use the MacroAssembler API pretty pessimistically, for example in i32.add:
m_jit.move(ImmHelpers::regLocation(lhsLocation, rhsLocation).asGPR(), resultLocation.asGPR());
m_jit.add32(Imm32(ImmHelpers::imm(lhs, rhs).asI32()), resultLocation.asGPR());
It's well-supported in our MacroAssembler to perform a three-operand add (and other arithmetic instructions) even on platforms like x86, so we should just use that. It should save us from obviously redundant codegen like the following on ARM:
mov x1, x0
add x1, x1, #1
...and allow us to use instructions like lea on x86 to accomplish much the same.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/126695575>
David Degazio
*** Bug 272902 has been marked as a duplicate of this bug. ***
David Degazio
Pull request: https://github.com/WebKit/WebKit/pull/27473
EWS
Committed 277770@main (7a2375d28da4): <https://commits.webkit.org/277770@main>
Reviewed commits have been landed. Closing PR #27473 and removing active labels.
Fujii Hironori
Regressed: Bug 273048 – REGRESSION(277770@main): [Mac WK1, GTK, WPE, Win] ASSERTION FAILED: v <= 0 under MacroAssemblerX86Common::sub32