Revert "cmd/compile: avoid panic in ternary rewrite on checked instructions"

This reverts CL 745460.

Reason for revert: This just disables the optimization, instead of fixing it.

Change-Id: I26350d08c847f666d12450d484312d0baf5f1112
Reviewed-on: https://go-review.googlesource.com/c/go/+/749161
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
David Chase
2026-02-25 11:33:49 -08:00
parent 8411ab9d3d
commit ed0367718f
2 changed files with 0 additions and 32 deletions

View File

@@ -1,29 +0,0 @@
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build goexperiment.simd && amd64
package ssa
import (
"testing"
"cmd/compile/internal/archsimd"
)
func TestVPTERNLOGDPanic(t *testing.T) {
if !archsimd.X86.AVX512() {
t.Skip("Test only applies to AVX512")
}
resultsMask := archsimd.Mask64x8{}
a := archsimd.Mask64x8FromBits(0xFF)
b := archsimd.Float64x8{}.Less(archsimd.Float64x8{})
for i := 0; i < 1; i++ {
resultsMask = a.Or(b).Or(resultsMask)
// This nested logic triggered the panic
_ = resultsMask.And(resultsMask.And(archsimd.Mask64x8{}))
}
}

View File

@@ -174,9 +174,6 @@ func rewriteTern(f *Func) {
replace := func(a0 *Value, vars0 [3]*Value) {
imm := computeTT(a0, vars0)
op := ternOpForLogical(a0.Op)
if a0.Op >= OpAMD64LoweredGetClosurePtr {
return // It is already an AMD64 machine instruction
}
if op == a0.Op {
panic(fmt.Errorf("should have mapped away from input op, a0 is %s", a0.LongString()))
}