diff options
author | David Chase <drchase@google.com> | 2019-11-02 23:57:11 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2020-04-03 17:24:48 +0000 |
commit | 47ade08141b23cfeafed92943e16012d5dc5eb8b (patch) | |
tree | 0e38e95ad3de867e5151cf61e811c56999401a69 /src/cmd/compile/internal/ssa/rewriteARM.go | |
parent | 3103495fa9bb166c9d0c56fbf3cd2146f32aef57 (diff) | |
download | go-47ade08141b23cfeafed92943e16012d5dc5eb8b.tar.gz go-47ade08141b23cfeafed92943e16012d5dc5eb8b.zip |
cmd/compile: add logging for large (>= 128 byte) copies
For 1.15, unless someone really wants it in 1.14.
A performance-sensitive user thought this would be useful,
though "large" was not well-defined. If 128 is large,
there are 139 static instances of "large" copies in the compiler
itself.
Includes test.
Change-Id: I81f20c62da59d37072429f3a22c1809e6fb2946d
Reviewed-on: https://go-review.googlesource.com/c/go/+/205066
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewriteARM.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewriteARM.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/rewriteARM.go b/src/cmd/compile/internal/ssa/rewriteARM.go index 91ef5fe14f..6af335698d 100644 --- a/src/cmd/compile/internal/ssa/rewriteARM.go +++ b/src/cmd/compile/internal/ssa/rewriteARM.go @@ -15228,7 +15228,7 @@ func rewriteValueARM_OpMove(v *Value) bool { return true } // match: (Move [s] {t} dst src mem) - // cond: s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice + // cond: s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s) // result: (DUFFCOPY [8 * (128 - s/4)] dst src mem) for { s := v.AuxInt @@ -15236,7 +15236,7 @@ func rewriteValueARM_OpMove(v *Value) bool { dst := v_0 src := v_1 mem := v_2 - if !(s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice) { + if !(s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) { break } v.reset(OpARMDUFFCOPY) @@ -15245,7 +15245,7 @@ func rewriteValueARM_OpMove(v *Value) bool { return true } // match: (Move [s] {t} dst src mem) - // cond: (s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0 + // cond: ((s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0) && logLargeCopy(v, s) // result: (LoweredMove [t.(*types.Type).Alignment()] dst src (ADDconst <src.Type> src [s-moveSize(t.(*types.Type).Alignment(), config)]) mem) for { s := v.AuxInt @@ -15253,7 +15253,7 @@ func rewriteValueARM_OpMove(v *Value) bool { dst := v_0 src := v_1 mem := v_2 - if !((s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0) { + if !(((s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0) && logLargeCopy(v, s)) { break } v.reset(OpARMLoweredMove) |