Skip to content

Commit 0753396

Browse files
limeidanabner-chenc
authored andcommitted
cmd/compile/internal/ssa: optimize store-zero rules on loong64
Change-Id: I4c6ce7b77da05636895127de7bc687c59bd79787 Reviewed-on: https://go-review.googlesource.com/c/go/+/620975 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: abner chenc <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent c6531fa commit 0753396

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

src/cmd/compile/internal/ssa/_gen/LOONG64.rules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,11 @@
569569
(MOVWstore [off] {sym} ptr (MOVWreg x) mem) => (MOVWstore [off] {sym} ptr x mem)
570570
(MOVWstore [off] {sym} ptr (MOVWUreg x) mem) => (MOVWstore [off] {sym} ptr x mem)
571571

572+
(MOVBstore [off] {sym} ptr (MOVVconst [0]) mem) => (MOVBstorezero [off] {sym} ptr mem)
573+
(MOVHstore [off] {sym} ptr (MOVVconst [0]) mem) => (MOVHstorezero [off] {sym} ptr mem)
574+
(MOVWstore [off] {sym} ptr (MOVVconst [0]) mem) => (MOVWstorezero [off] {sym} ptr mem)
575+
(MOVVstore [off] {sym} ptr (MOVVconst [0]) mem) => (MOVVstorezero [off] {sym} ptr mem)
576+
572577
// register indexed load
573578
(MOVVload [off] {sym} (ADDV ptr idx) mem) && off == 0 && sym == nil => (MOVVloadidx ptr idx mem)
574579
(MOVWUload [off] {sym} (ADDV ptr idx) mem) && off == 0 && sym == nil => (MOVWUloadidx ptr idx mem)

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

Lines changed: 64 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)