Source file src/cmd/compile/internal/ssa/rewrite/amd64latelower/amd64latelower_helpers.go

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package amd64latelower
     6  
     7  import (
     8  	"internal/buildcfg"
     9  
    10  	"cmd/compile/internal/ssa"
    11  )
    12  
    13  // hasAVX2 reports whether AVX2 instructions may be used for v, either because
    14  // GOAMD64 requires AVX2 or because the cpufeatures pass proved that v's block
    15  // only runs on CPUs with AVX2.
    16  func hasAVX2(v *ssa.Value) bool {
    17  	return buildcfg.GOAMD64 >= 3 || v.Block.CPUfeatures.HasFeature(ssa.CPUavx2)
    18  }
    19  

View as plain text