diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2020-01-23 22:18:30 -0800 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2020-02-21 17:28:10 +0000 |
commit | 1b47fde55c3899ee50e7fab35e151645aba96e9c (patch) | |
tree | ce3c389c8ce8269aedc8d3a6f60ead6e244c77bb /src/cmd/compile/internal/ssa/prove.go | |
parent | e932f0addc7d764a6bd534979b5cabaf0c1a6ad8 (diff) | |
download | go-1b47fde55c3899ee50e7fab35e151645aba96e9c.tar.gz go-1b47fde55c3899ee50e7fab35e151645aba96e9c.zip |
cmd/compile: clarify division bounds check optimization
The name of the function should mention division.
Eliminate double negatives from the comment describing it.
Change-Id: Icef1a5139b3a91b86acb930af97938f5160f7342
Reviewed-on: https://go-review.googlesource.com/c/go/+/217001
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Diffstat (limited to 'src/cmd/compile/internal/ssa/prove.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/prove.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go index 774fa94dbc..01825579d9 100644 --- a/src/cmd/compile/internal/ssa/prove.go +++ b/src/cmd/compile/internal/ssa/prove.go @@ -1243,9 +1243,11 @@ func simplifyBlock(sdom SparseTree, ft *factsTable, b *Block) { divdLim, divdLimok := ft.limits[divd.ID] if (divrLimok && (divrLim.max < -1 || divrLim.min > -1)) || (divdLimok && divdLim.min > mostNegativeDividend[v.Op]) { - v.AuxInt = 1 // see NeedsFixUp in genericOps - v.AuxInt = 0 means we have not proved - // that the divisor is not -1 and the dividend is not the most negative, - // so we need to add fix-up code. + // See DivisionNeedsFixUp in rewrite.go. + // v.AuxInt = 1 means we have proved both that the divisor is not -1 + // and that the dividend is not the most negative integer, + // so we do not need to add fix-up code. + v.AuxInt = 1 if b.Func.pass.debug > 0 { b.Func.Warnl(v.Pos, "Proved %v does not need fix-up", v.Op) } |