From: Junyang Shao Date: Fri, 19 Sep 2025 18:38:25 +0000 (+0000) Subject: [dev.simd] cmd/compile: fix SIMD const rematerialization condition X-Git-Tag: go1.26rc1~147^2~64 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=63a09d6d3d;p=gostls13.git [dev.simd] cmd/compile: fix SIMD const rematerialization condition This CL fixes a condition for the previous fix CL 704056. Change-Id: I1f1f8c6f72870403cb3dff14755c43385dc0c933 Reviewed-on: https://go-review.googlesource.com/c/go/+/705499 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui --- diff --git a/src/cmd/compile/internal/ssa/regalloc.go b/src/cmd/compile/internal/ssa/regalloc.go index fe30b89cdd..bcb5dec09d 100644 --- a/src/cmd/compile/internal/ssa/regalloc.go +++ b/src/cmd/compile/internal/ssa/regalloc.go @@ -2576,22 +2576,25 @@ func (e *edgeState) processDest(loc Location, vid ID, splice **Value, pos src.XP e.s.f.Fatalf("can't find source for %s->%s: %s\n", e.p, e.b, v.LongString()) } if dstReg { - // Handle incompatible registers. + // We want to rematerialize v into a register that is incompatible with v's op's register mask. + // Instead of setting the wrong register for the rematerialized v, we should find the right register + // for it and emit an additional copy to move to the desired register. // For #70451. - if e.s.regspec(v).outputs[0].regs®Mask(1<