mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/ssa: use Compare instead of Equal
They have different semantics. Equal is stricter and is designed for the front-end. Compare is looser and cheaper and is designed for the back-end. To avoid possible regression, remove Equal from ssa.Type. Updates #15043 Change-Id: Ie23ce75ff6b4d01b7982e0a89e6f81b5d099d8d6 Reviewed-on: https://go-review.googlesource.com/21483 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
462aa7ec7b
commit
2563b6f9fe
6 changed files with 8 additions and 26 deletions
|
|
@ -318,7 +318,7 @@ func (f *Func) constVal(line int32, op Op, t Type, c int64, setAux bool) *Value
|
|||
}
|
||||
vv := f.constants[c]
|
||||
for _, v := range vv {
|
||||
if v.Op == op && v.Type.Equal(t) {
|
||||
if v.Op == op && v.Type.Compare(t) == CMPeq {
|
||||
if setAux && v.AuxInt != c {
|
||||
panic(fmt.Sprintf("cached const %s should have AuxInt of %d", v.LongString(), c))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue