mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add position info to sccp debug messages
Change-Id: Ic568dd3b2e3ebebb1b6aaa41ee78a12d4e8d3f06 Reviewed-on: https://go-review.googlesource.com/c/go/+/714221 Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
77dc138030
commit
9a77aa4f08
1 changed files with 3 additions and 7 deletions
|
|
@ -4,10 +4,6 @@
|
||||||
|
|
||||||
package ssa
|
package ssa
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Sparse Conditional Constant Propagation
|
// Sparse Conditional Constant Propagation
|
||||||
//
|
//
|
||||||
|
|
@ -118,7 +114,7 @@ func sccp(f *Func) {
|
||||||
constCnt, rewireCnt := t.replaceConst()
|
constCnt, rewireCnt := t.replaceConst()
|
||||||
if f.pass.debug > 0 {
|
if f.pass.debug > 0 {
|
||||||
if constCnt > 0 || rewireCnt > 0 {
|
if constCnt > 0 || rewireCnt > 0 {
|
||||||
fmt.Printf("Phase SCCP for %v : %v constants, %v dce\n", f.Name, constCnt, rewireCnt)
|
f.Warnl(f.Entry.Pos, "Phase SCCP for %v : %v constants, %v dce", f.Name, constCnt, rewireCnt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -563,7 +559,7 @@ func (t *worklist) replaceConst() (int, int) {
|
||||||
if lt.tag == constant {
|
if lt.tag == constant {
|
||||||
if !isConst(val) {
|
if !isConst(val) {
|
||||||
if t.f.pass.debug > 0 {
|
if t.f.pass.debug > 0 {
|
||||||
fmt.Printf("Replace %v with %v\n", val.LongString(), lt.val.LongString())
|
t.f.Warnl(val.Pos, "Replace %v with %v", val.LongString(), lt.val.LongString())
|
||||||
}
|
}
|
||||||
val.reset(lt.val.Op)
|
val.reset(lt.val.Op)
|
||||||
val.AuxInt = lt.val.AuxInt
|
val.AuxInt = lt.val.AuxInt
|
||||||
|
|
@ -575,7 +571,7 @@ func (t *worklist) replaceConst() (int, int) {
|
||||||
if rewireSuccessor(block, lt.val) {
|
if rewireSuccessor(block, lt.val) {
|
||||||
rewireCnt++
|
rewireCnt++
|
||||||
if t.f.pass.debug > 0 {
|
if t.f.pass.debug > 0 {
|
||||||
fmt.Printf("Rewire %v %v successors\n", block.Kind, block)
|
t.f.Warnl(block.Pos, "Rewire %v %v successors", block.Kind, block)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue