diff options
| author | Junyang Shao <shaojunyang@google.com> | 2025-07-10 22:04:21 +0000 |
|---|---|---|
| committer | Junyang Shao <shaojunyang@google.com> | 2025-07-11 12:07:31 -0700 |
| commit | 1440ff70362f85c86b54b5c428fd95cb6cb35d91 (patch) | |
| tree | 80e8be244c6eb7c02e496f4d1d7c9301c9b9ec3c /src/cmd/compile | |
| parent | ccb43dcec791cb70431840ec2138addb489b828e (diff) | |
| download | go-1440ff70362f85c86b54b5c428fd95cb6cb35d91.tar.xz | |
[dev.simd] cmd/compile: exclude simd vars from merge local
It looks like mergelocals pass's liveness analysis does not handle simd
variables well.
The added test forces two vectors to spill in a way that does not work
with mergelocals: if the added check is removed, then `v` and `m` will
be marked merged and spilled to the same location, failing the test.
Change-Id: Ife4e4e939565d817fc24f7180cb791a5084dd191
Reviewed-on: https://go-review.googlesource.com/c/go/+/687375
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile')
| -rw-r--r-- | src/cmd/compile/internal/ssa/func.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/func.go b/src/cmd/compile/internal/ssa/func.go index 5736f0b812..01ce89cf47 100644 --- a/src/cmd/compile/internal/ssa/func.go +++ b/src/cmd/compile/internal/ssa/func.go @@ -850,6 +850,13 @@ func (f *Func) NewLocal(pos src.XPos, typ *types.Type) *ir.Name { // items larger than what CanSSA would allow (approximateky, we disallow things // marked as open defer slots so as to avoid complicating liveness // analysis. +// +// TODO: make SIMD variables mergible. +// +// Right now this check excludes SIMD vars because sometimes two live SIMD +// vectors will be put into the same partition by mergelocals, we need to figure +// out why because these vectors are big and should be merged when possible. +// Details in CL 687375. func IsMergeCandidate(n *ir.Name) bool { if base.Debug.MergeLocals == 0 || base.Flag.N != 0 || @@ -857,6 +864,7 @@ func IsMergeCandidate(n *ir.Name) bool { n.Type().Size() <= int64(3*types.PtrSize) || n.Addrtaken() || n.NonMergeable() || + n.Type().IsSIMD() || n.OpenDeferSlot() { return false } |
