Commit 7e74e433 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

[dev.ssa] cmd/compile: minor cleanup

Cull dead code. Add TODOs.

Change-Id: I81d24371de47f5a27d3a3a0ec0ef5baaf6814c06
Reviewed-on: https://go-review.googlesource.com/12659Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 71b57077
......@@ -1114,6 +1114,8 @@ func canSSA(n *Node) bool {
// nilCheck generates nil pointer checking code.
// Starts a new block on return.
// Used only for automatically inserted nil checks,
// not for user code like 'x != nil'.
func (s *state) nilCheck(ptr *ssa.Value) {
c := s.newValue1(ssa.OpIsNonNil, ssa.TypeBool, ptr)
b := s.endBlock()
......@@ -1466,7 +1468,6 @@ func genValue(v *ssa.Value) {
p.From.Reg = x
p.To.Type = obj.TYPE_REG
p.To.Reg = r
x = r
}
p := Prog(x86.ASUBQ)
p.From.Type = obj.TYPE_CONST
......@@ -1485,7 +1486,6 @@ func genValue(v *ssa.Value) {
p.From.Reg = x
p.To.Type = obj.TYPE_REG
p.To.Reg = r
x = r
}
p := Prog(v.Op.Asm())
p.From.Type = obj.TYPE_REG
......@@ -1501,7 +1501,6 @@ func genValue(v *ssa.Value) {
p.From.Reg = x
p.To.Type = obj.TYPE_REG
p.To.Reg = r
x = r
}
p := Prog(v.Op.Asm())
p.From.Type = obj.TYPE_CONST
......
......@@ -52,6 +52,9 @@ Common-Subexpression Elimination
- Can we move control values out of their basic block?
This would break nilcheckelim as currently implemented,
but it could be replaced by a similar CFG simplication pass.
- Investigate type equality. During SSA generation, should we use n.Type or (say) TypeBool?
Should we get rid of named types in favor of underlying types during SSA generation?
Should we introduce a new type equality routine that is less strict than the frontend's?
Other
- Write barriers
......@@ -63,3 +66,4 @@ Other
- make deadstore work with zeroing.
- Add a value range propagation optimization pass.
Use it for bounds check elimination and bitwidth reduction.
- Branch prediction: Respect hints from the frontend, add our own.
......@@ -153,7 +153,7 @@ var genericOps = []opData{
{name: "Convert"}, // convert arg0 to another type
{name: "ConvNop"}, // interpret arg0 as another type
// Safety checks
// Automatically inserted safety checks
{name: "IsNonNil"}, // arg0 != nil
{name: "IsInBounds"}, // 0 <= arg0 < arg1
......
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