Closed Bug 2070557 Opened 2 months ago Closed 2 months ago

[riscv64] Elide redundant no-op `mv`-like instructions when applicable

Categories

(Core :: JavaScript Engine: JIT, task, P2)

RISCV64
Unspecified
task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: csmantle, Assigned: csmantle)

References

(Blocks 1 open bug)

Details

Attachments

(6 external files)

The riscv64 backend currently generates some no-op self-moves and other similar no-op instructions. We could try to eliminate them.

Recently, I have extended LoongLint with multi-architecture support, including riscv64. This optimization is discovered when evaluating LoongLint on riscv64 JITDumps produced by Octane. In total, this elides ~204 such instructions on this benchmark

This function will be used in later parts. Keep AssemblerRISCVI::mv()
intact since it corresponds to an actual RISC-V pseudo-instruction.

Per LoongLint for RISC-V, this eliminates 9 (out of 206) non-canonical
nops on Octane with codegen profile RVA23U64.

Per LoongLint for RISC-V, this further eliminates 91 (out of 206)
no-ops on Octane.

Per LoongLint for RISC-V, this further eliminates 106 (out of 206)
no-ops on Octane.

Attachment #9639693 - Attachment description: Bug 2070557 - [riscv64] Part 1: Switch to explicit addi in MacroAssembler::wasmMarkCallAsSlow(). r=jandem → Bug 2070557 - [riscv64] Part 1: Switch to explicit addi in MacroAssembler::wasmMarkCallAsSlow(). r=jandem!
Severity: -- → N/A
Priority: -- → P2
Pushed by webmaster@csmantle.top: https://github.com/mozilla-firefox/firefox/commit/3aea2ef8711f https://hg.mozilla.org/integration/autoland/rev/43a089a7f75a [riscv64] Part 1: Switch to explicit addi in MacroAssembler::wasmMarkCallAsSlow(). r=jandem https://github.com/mozilla-firefox/firefox/commit/cf5bdde07db8 https://hg.mozilla.org/integration/autoland/rev/db02850efbba [riscv64] Part 2: Introduce ma_mv for elidable moves. r=jandem https://github.com/mozilla-firefox/firefox/commit/b58508c62abb https://hg.mozilla.org/integration/autoland/rev/a5ba46738f1a [riscv64] Part 3: Switch to ma_mv when applicable. r=jandem https://github.com/mozilla-firefox/firefox/commit/9493753816b9 https://hg.mozilla.org/integration/autoland/rev/1f3f049aaade [riscv64] Part 4: Optimize zero immediate cases in ma_add64(Register, Register, Imm64). r=jandem https://github.com/mozilla-firefox/firefox/commit/0c14642b2ada https://hg.mozilla.org/integration/autoland/rev/769a3b9b835f [riscv64] Part 5: Optimize zero immediate cases in ma_or(Register, Register, Imm64). r=jandem https://github.com/mozilla-firefox/firefox/commit/aa9130393f2e https://hg.mozilla.org/integration/autoland/rev/702064d2d252 [riscv64] Part 6: Optimize zero immediate cases in ma_sub64(Register, Register, Imm64). r=jandem
QA Whiteboard: [qa-triage-done-c159/b158]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: