]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: clean up comparisons
authorKeith Randall <khr@golang.org>
Tue, 5 Jan 2016 22:56:26 +0000 (14:56 -0800)
committerKeith Randall <khr@golang.org>
Wed, 13 Jan 2016 18:42:00 +0000 (18:42 +0000)
commit3425295e915bc16236f2c021317705aca34319af
tree3d9adc97103ae2c92c95f777ca1339d0797a6bdd
parent9094e3ada2de3cc8129b70730c2c0782a4040201
[dev.ssa] cmd/compile: clean up comparisons

Add new constant-flags opcodes.  These can be generated from
comparisons that we know the result of, like x&31 < 32.

Constant-fold the constant-flags opcodes into all flag users.

Reorder some CMPxconst args so they read in the comparison direction.

Reorg deadcode removal a bit - it needs to remove the OpCopy ops it
generates when strength-reducing Phi ops.  So it needs to splice out all
the dead blocks and do a copy elimination before it computes live
values.

Change-Id: Ie922602033592ad8212efe4345394973d3b94d9f
Reviewed-on: https://go-review.googlesource.com/18267
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/copyelim.go
src/cmd/compile/internal/ssa/deadcode.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/lower.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go