mirror of
https://github.com/golang/go
synced 2024-11-23 16:40:03 -07:00
cmd/compile: log large copies on riscv64
Log large copies in the riscv64 compiler.
This was missed in 47ade08141
, resulting in
the new test added to cmd/compile/internal/logopt failing on riscv64.
Change-Id: I6f763e86f42834148e911d16928f9fbabcfa4290
Reviewed-on: https://go-review.googlesource.com/c/go/+/227804
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
1eb66be1b9
commit
fb16f4b82e
@ -404,7 +404,7 @@
|
||||
(Move [8] dst src mem) -> (MOVDstore dst (MOVDload src mem) mem)
|
||||
|
||||
// Generic move uses a loop
|
||||
(Move [s] {t} dst src mem) ->
|
||||
(Move [s] {t} dst src mem) && (s <= 16 || logLargeCopy(v, s)) ->
|
||||
(LoweredMove [t.(*types.Type).Alignment()]
|
||||
dst
|
||||
src
|
||||
|
@ -1894,6 +1894,7 @@ func rewriteValueRISCV64_OpMove(v *Value) bool {
|
||||
return true
|
||||
}
|
||||
// match: (Move [s] {t} dst src mem)
|
||||
// cond: (s <= 16 || logLargeCopy(v, s))
|
||||
// result: (LoweredMove [t.(*types.Type).Alignment()] dst src (ADDI <src.Type> [s-moveSize(t.(*types.Type).Alignment(), config)] src) mem)
|
||||
for {
|
||||
s := v.AuxInt
|
||||
@ -1901,6 +1902,9 @@ func rewriteValueRISCV64_OpMove(v *Value) bool {
|
||||
dst := v_0
|
||||
src := v_1
|
||||
mem := v_2
|
||||
if !(s <= 16 || logLargeCopy(v, s)) {
|
||||
break
|
||||
}
|
||||
v.reset(OpRISCV64LoweredMove)
|
||||
v.AuxInt = t.(*types.Type).Alignment()
|
||||
v0 := b.NewValue0(v.Pos, OpRISCV64ADDI, src.Type)
|
||||
@ -1909,6 +1913,7 @@ func rewriteValueRISCV64_OpMove(v *Value) bool {
|
||||
v.AddArg4(dst, src, v0, mem)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
func rewriteValueRISCV64_OpMul16(v *Value) bool {
|
||||
v_1 := v.Args[1]
|
||||
|
Loading…
Reference in New Issue
Block a user