Skip to content

cmd/compile: sparse conditional constant propagation #59575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
2 changes: 2 additions & 0 deletions src/cmd/compile/internal/ssa/_gen/genericOps.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ var genericOps = []opData{
// Plain [] [next]
// If [boolean Value] [then, else]
// First [] [always, never]
// Defer [mem] [nopanic, panic] (control opcode should be OpStaticCall to runtime.deferproc)
//JumpTable [integer Value] [succ1,succ2,..]

var genericBlocks = []blockData{
{name: "Plain"}, // a single successor
Expand Down
10 changes: 1 addition & 9 deletions src/cmd/compile/internal/ssa/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ func (e Edge) String() string {
}

// BlockKind is the kind of SSA block.
//
// kind controls successors
// ------------------------------------------
// Exit [return mem] []
// Plain [] [next]
// If [boolean Value] [then, else]
// Defer [mem] [nopanic, panic] (control opcode should be OpStaticCall to runtime.deferproc)
type BlockKind int16

// short form print
Expand Down Expand Up @@ -275,8 +268,7 @@ func (b *Block) truncateValues(i int) {
b.Values = b.Values[:i]
}

// AddEdgeTo adds an edge from block b to block c. Used during building of the
// SSA graph; do not use on an already-completed SSA graph.
// AddEdgeTo adds an edge from block b to block c.
func (b *Block) AddEdgeTo(c *Block) {
i := len(b.Succs)
j := len(c.Preds)
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/ssa/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ var passes = [...]pass{
{name: "softfloat", fn: softfloat, required: true},
{name: "late opt", fn: opt, required: true}, // TODO: split required rules and optimizing rules
{name: "dead auto elim", fn: elimDeadAutosGeneric},
{name: "sccp", fn: sccp},
{name: "generic deadcode", fn: deadcode, required: true}, // remove dead stores, which otherwise mess up store chain
{name: "check bce", fn: checkbce},
{name: "branchelim", fn: branchelim},
Expand Down
Loading