Commit 46085c4b authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: cmd/internal/obj: cull dead code

This code is dead as a result of

* removing the Follow pass
* moving rotation detection from walk to ssa

Change-Id: I14599c85bedb4e3148347b547e724187920182c4
Reviewed-on: https://go-review.googlesource.com/36484
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 160914e3
......@@ -1411,15 +1411,6 @@ func (s *state) ssaShiftOp(op Op, t *Type, u *Type) ssa.Op {
return x
}
func (s *state) ssaRotateOp(op Op, t *Type) ssa.Op {
etype1 := s.concreteEtype(t)
x, ok := opToSSA[opAndType{op, etype1}]
if !ok {
s.Fatalf("unhandled rotate op %v etype=%s", op, etype1)
}
return x
}
// expr converts the expression n to ssa, adds it to s and returns the ssa result.
func (s *state) expr(n *Node) *ssa.Value {
if !(n.Op == ONAME || n.Op == OLITERAL && n.Sym != nil) {
......
......@@ -3234,37 +3234,6 @@ func finishcompare(n, r *Node, init *Nodes) *Node {
return nn
}
func samecheap(a *Node, b *Node) bool {
var ar *Node
var br *Node
for a != nil && b != nil && a.Op == b.Op {
switch a.Op {
default:
return false
case ONAME:
return a == b
case ODOT, ODOTPTR:
if a.Sym != b.Sym {
return false
}
case OINDEX:
ar = a.Right
br = b.Right
if !Isconst(ar, CTINT) || !Isconst(br, CTINT) || ar.Val().U.(*Mpint).Cmp(br.Val().U.(*Mpint)) != 0 {
return false
}
}
a = a.Left
b = b.Left
}
return false
}
// isIntOrdering reports whether n is a <, ≤, >, or ≥ ordering between integers.
func (n *Node) isIntOrdering() bool {
switch n.Op {
......
......@@ -32,17 +32,6 @@ package obj
// Code and data passes.
func Brchain(ctxt *Link, p *Prog) *Prog {
for i := 0; i < 20; i++ {
if p == nil || p.As != AJMP || p.Pcond == nil {
return p
}
p = p.Pcond
}
return nil
}
func brloop(ctxt *Link, p *Prog) *Prog {
var q *Prog
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment