]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add automated rewrite cycle detection
authorJosh Bleecher Snyder <josharian@gmail.com>
Sun, 5 Sep 2021 02:29:08 +0000 (19:29 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 8 Sep 2021 22:47:57 +0000 (22:47 +0000)
commitbff39cf6cb5bbe1575fdd95682c991ef35e97289
treed967f8743f510e55d0b08eb38eda309c7eec8ad0
parentb61e1ed863886743598c6f816b0740f3768b50f6
cmd/compile: add automated rewrite cycle detection

A common bug during development is to introduce rewrite rule cycles.
This is annoying because it takes a while to notice that
make.bash is a bit too slow this time, and to remember why.
And then you have to manually arrange to debug.

Make this all easier by automating it.
Detect cycles, and when we detect one, print the sequence
of rewrite rules that occur within a single cycle before crashing.

Change-Id: I8dadda13990ab925a81940d4833c9e5243368435
Reviewed-on: https://go-review.googlesource.com/c/go/+/347829
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/ssa/html.go
src/cmd/compile/internal/ssa/print.go
src/cmd/compile/internal/ssa/rewrite.go