Skip to content

Commit 38f8596

Browse files
limeidanabner-chenc
authored andcommitted
cmd/compile/internal/ssa: optimize if control flow rule of loong64
goos: linux goarch: loong64 pkg: cmd/compile/internal/test cpu: Loongson-3A6000 @ 2500.00MHz │ old │ new │ │ sec/op │ sec/op vs base │ Switch8Predictable 2.908n ± 0% 2.702n ± 2% -7.10% (p=0.000 n=10) Switch8Unpredictable 13.29n ± 0% 12.45n ± 0% -6.32% (p=0.000 n=10) Switch32Predictable 3.069n ± 0% 3.137n ± 0% +2.23% (p=0.000 n=10) Switch32Unpredictable 15.11n ± 0% 13.21n ± 0% -12.57% (p=0.000 n=10) SwitchStringPredictable 5.165n ± 0% 4.447n ± 0% -13.90% (p=0.000 n=10) SwitchStringUnpredictable 18.26n ± 0% 16.86n ± 0% -7.67% (p=0.000 n=10) SwitchTypePredictable 3.961n ± 0% 3.405n ± 0% -14.04% (p=0.000 n=10) SwitchTypeUnpredictable 17.92n ± 0% 16.17n ± 0% -9.77% (p=0.000 n=10) SwitchInterfaceTypePredictable 8.463n ± 0% 8.492n ± 0% +0.34% (p=0.001 n=10) SwitchInterfaceTypeUnpredictable 23.70n ± 0% 22.48n ± 0% -5.15% (p=0.000 n=10) geomean 8.672n 8.018n -7.54% Change-Id: Iefbf8e9e784905779f1ebc9fd6a9b7a28cf2f6f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/620815 Reviewed-by: abner chenc <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 4bfc81a commit 38f8596

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@
453453
(GetCallerPC ...) => (LoweredGetCallerPC ...)
454454

455455
(If cond yes no) => (NE (MOVBUreg <typ.UInt64> cond) yes no)
456+
(MOVBUreg x:(XOR (MOVVconst [1]) ((SGT|SGTU) _ _))) => x
456457

457458
// Write barrier.
458459
(WB ...) => (LoweredWB ...)

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

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)