Skip to content

Commit ce72766

Browse files
committed
cmd/compile: improve PPC64 rules for AtomicLoad{8,32}
This adds a rule to avoid the zero extension after an AtomicLoad8 or AtomicLoad32 since the atomic load has already filled it with zeros. This eliminates an instruction in a high use block in findObject and the AtomicLoad8 appears many times within runtime. Change-Id: I7e684bf73d3812110bd371e05b1aa44fa235fc9b Reviewed-on: https://go-review.googlesource.com/c/go/+/354029 Run-TryBot: Lynn Boger <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Trust: Lynn Boger <[email protected]>
1 parent 72c52bf commit ce72766

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,8 @@
10191019
(MOVWZreg x:(MOVWZloadidx _ _ _)) => x
10201020
(MOVWreg x:(MOVWload _ _)) => x
10211021
(MOVWreg x:(MOVWloadidx _ _ _)) => x
1022+
(MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _))) => x
1023+
(MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _))) => x
10221024

10231025
// don't extend if argument is already extended
10241026
(MOVBreg x:(Arg <t>)) && is8BitInt(t) && isSigned(t) => x

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

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