]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make rulegen magic variable prediction more precise
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 18 Dec 2018 01:12:00 +0000 (17:12 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 12 Mar 2019 20:13:46 +0000 (20:13 +0000)
commit53948127d32cd8ab2d67941542122491a9cd22c9
treeab09159366eaf449565d8fd0937e78683bc6cbf0
parentf54b8909ac93637159e2661f25aef5e61e8cd8fc
cmd/compile: make rulegen magic variable prediction more precise

The sheer length of the generated rules files makes my
editor and git client unhappy.
This change is a small step towards shortening them.

We recognize a few magic variables during rulegen: b, config, fe, typ.
Of these, only b appears prone to false positives.
By tightening the heuristic and fixing one case in MIPS.rules,
we can make the heuristic enough that it has no failures.
That allows us to remove the hedge assignments to _,
removing 3000 pointless lines of code.

Change-Id: I080cde5db28c8277cb3fd9ddcd829306c9a27785
Reviewed-on: https://go-review.googlesource.com/c/go/+/166979
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
15 files changed:
src/cmd/compile/internal/ssa/gen/MIPS.rules
src/cmd/compile/internal/ssa/gen/rulegen.go
src/cmd/compile/internal/ssa/rewrite386.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM.go
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteMIPS.go
src/cmd/compile/internal/ssa/rewriteMIPS64.go
src/cmd/compile/internal/ssa/rewritePPC64.go
src/cmd/compile/internal/ssa/rewriteS390X.go
src/cmd/compile/internal/ssa/rewriteWasm.go
src/cmd/compile/internal/ssa/rewritedec.go
src/cmd/compile/internal/ssa/rewritedec64.go
src/cmd/compile/internal/ssa/rewritedecArgs.go
src/cmd/compile/internal/ssa/rewritegeneric.go