Skip to content

Commit c9ece81

Browse files
committed
cmd/compile: absorb SNEZ into branch on riscv64
Change-Id: I55fd93843a7fb574a7dd66ebb87fdd96e944d555 Reviewed-on: https://go-review.googlesource.com/c/go/+/221682 Reviewed-by: Cherry Zhang <[email protected]>
1 parent d28b852 commit c9ece81

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/cmd/compile/internal/ssa/gen/RISCV64.rules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@
458458

459459
// Optimizations
460460

461+
// Absorb SNEZ into branch.
462+
(BNE (SNEZ x) yes no) -> (BNE x yes no)
463+
461464
// Fold ADD+MOVDconst into ADDI where possible.
462465
(ADD (MOVDconst [off]) ptr) && is32Bit(off) -> (ADDI [off] ptr)
463466

src/cmd/compile/internal/ssa/rewriteRISCV64.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)