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:
Josh Bleecher Snyder 2016-04-03 14:44:29 -07:00
parent 462aa7ec7b
commit 2563b6f9fe
6 changed files with 8 additions and 26 deletions

View file

@ -108,7 +108,7 @@ func cse(f *Func) {
break
}
}
if !equivalent || !v.Type.Equal(w.Type) {
if !equivalent || v.Type.Compare(w.Type) != CMPeq {
// w is not equivalent to v.
// move it to the end and shrink e.
e[j], e[len(e)-1] = e[len(e)-1], e[j]