We don't need them any more since #15837 was fixed.
Fixes #19718
Change-Id: I13e46c62b321b2c9265f44c977b63bfb23163ca2
Reviewed-on: https://go-review.googlesource.com/38664
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
ssa.BlockAMD64ULT, ssa.BlockAMD64UGT,
ssa.BlockAMD64ULE, ssa.BlockAMD64UGE:
jmp := blockJump[b.Kind]
- likely := b.Likely
var p *obj.Prog
switch next {
case b.Succs[0].Block():
p = s.Prog(jmp.invasm)
- likely *= -1
p.To.Type = obj.TYPE_BRANCH
s.Branches = append(s.Branches, gc.Branch{P: p, B: b.Succs[1].Block()})
case b.Succs[1].Block():
s.Branches = append(s.Branches, gc.Branch{P: q, B: b.Succs[1].Block()})
}
- // liblink reorders the instruction stream as it sees fit.
- // Pass along what we know so liblink can make use of it.
- // TODO: Once we've fully switched to SSA,
- // make liblink leave our output alone.
- switch likely {
- case ssa.BranchUnlikely:
- p.From.Type = obj.TYPE_CONST
- p.From.Offset = 0
- case ssa.BranchLikely:
- p.From.Type = obj.TYPE_CONST
- p.From.Offset = 1
- }
-
default:
b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
}
Index int
}
-func (s *SSAGenState) oneFPJump(b *ssa.Block, jumps *FloatingEQNEJump, likely ssa.BranchPrediction) {
+func (s *SSAGenState) oneFPJump(b *ssa.Block, jumps *FloatingEQNEJump) {
p := s.Prog(jumps.Jump)
p.To.Type = obj.TYPE_BRANCH
to := jumps.Index
s.Branches = append(s.Branches, Branch{p, b.Succs[to].Block()})
- if to == 1 {
- likely = -likely
- }
- // liblink reorders the instruction stream as it sees fit.
- // Pass along what we know so liblink can make use of it.
- // TODO: Once we've fully switched to SSA,
- // make liblink leave our output alone.
- switch likely {
- case ssa.BranchUnlikely:
- p.From.Type = obj.TYPE_CONST
- p.From.Offset = 0
- case ssa.BranchLikely:
- p.From.Type = obj.TYPE_CONST
- p.From.Offset = 1
- }
}
func (s *SSAGenState) FPJump(b, next *ssa.Block, jumps *[2][2]FloatingEQNEJump) {
- likely := b.Likely
switch next {
case b.Succs[0].Block():
- s.oneFPJump(b, &jumps[0][0], likely)
- s.oneFPJump(b, &jumps[0][1], likely)
+ s.oneFPJump(b, &jumps[0][0])
+ s.oneFPJump(b, &jumps[0][1])
case b.Succs[1].Block():
- s.oneFPJump(b, &jumps[1][0], likely)
- s.oneFPJump(b, &jumps[1][1], likely)
+ s.oneFPJump(b, &jumps[1][0])
+ s.oneFPJump(b, &jumps[1][1])
default:
- s.oneFPJump(b, &jumps[1][0], likely)
- s.oneFPJump(b, &jumps[1][1], likely)
+ s.oneFPJump(b, &jumps[1][0])
+ s.oneFPJump(b, &jumps[1][1])
q := s.Prog(obj.AJMP)
q.To.Type = obj.TYPE_BRANCH
s.Branches = append(s.Branches, Branch{q, b.Succs[1].Block()})
ssa.BlockPPC64FLT, ssa.BlockPPC64FGE,
ssa.BlockPPC64FLE, ssa.BlockPPC64FGT:
jmp := blockJump[b.Kind]
- likely := b.Likely
var p *obj.Prog
switch next {
case b.Succs[0].Block():
p = s.Prog(jmp.invasm)
- likely *= -1
p.To.Type = obj.TYPE_BRANCH
s.Branches = append(s.Branches, gc.Branch{P: p, B: b.Succs[1].Block()})
if jmp.invasmun {
s.Branches = append(s.Branches, gc.Branch{P: q, B: b.Succs[1].Block()})
}
- // liblink reorders the instruction stream as it sees fit.
- // Pass along what we know so liblink can make use of it.
- // TODO: Once we've fully switched to SSA,
- // make liblink leave our output alone.
- //switch likely {
- //case ssa.BranchUnlikely:
- // p.From.Type = obj.TYPE_CONST
- // p.From.Offset = 0
- //case ssa.BranchLikely:
- // p.From.Type = obj.TYPE_CONST
- // p.From.Offset = 1
- //}
-
default:
b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
}
ssa.BlockS390XLE, ssa.BlockS390XGT,
ssa.BlockS390XGEF, ssa.BlockS390XGTF:
jmp := blockJump[b.Kind]
- likely := b.Likely
var p *obj.Prog
switch next {
case b.Succs[0].Block():
p = s.Prog(jmp.invasm)
- likely *= -1
p.To.Type = obj.TYPE_BRANCH
s.Branches = append(s.Branches, gc.Branch{P: p, B: b.Succs[1].Block()})
case b.Succs[1].Block():
ssa.Block386ULT, ssa.Block386UGT,
ssa.Block386ULE, ssa.Block386UGE:
jmp := blockJump[b.Kind]
- likely := b.Likely
var p *obj.Prog
switch next {
case b.Succs[0].Block():
p = s.Prog(jmp.invasm)
- likely *= -1
p.To.Type = obj.TYPE_BRANCH
s.Branches = append(s.Branches, gc.Branch{P: p, B: b.Succs[1].Block()})
case b.Succs[1].Block():
s.Branches = append(s.Branches, gc.Branch{P: q, B: b.Succs[1].Block()})
}
- // liblink reorders the instruction stream as it sees fit.
- // Pass along what we know so liblink can make use of it.
- // TODO: Once we've fully switched to SSA,
- // make liblink leave our output alone.
- switch likely {
- case ssa.BranchUnlikely:
- p.From.Type = obj.TYPE_CONST
- p.From.Offset = 0
- case ssa.BranchLikely:
- p.From.Type = obj.TYPE_CONST
- p.From.Offset = 1
- }
-
default:
b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
}