aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/loopbce.go
diff options
context:
space:
mode:
authorGiovanni Bajo <rasky@develer.com>2018-04-02 01:57:49 +0200
committerGiovanni Bajo <rasky@develer.com>2018-04-29 09:37:35 +0000
commit7ec25d0acfed3f40fe634be518f0857704e5b642 (patch)
tree91b61b67232ce3d3bee6c94b24fbda21a0cdc3e7 /src/cmd/compile/internal/ssa/loopbce.go
parent29162ec9a7d4ee08a558729236cd9bf50febee09 (diff)
downloadgo-7ec25d0acfed3f40fe634be518f0857704e5b642.tar.gz
go-7ec25d0acfed3f40fe634be518f0857704e5b642.zip
cmd/compile: implement loop BCE in prove
Reuse findIndVar to discover induction variables, and then register the facts we know about them into the facts table when entering the loop block. Moreover, handle "x+delta > w" while updating the facts table, to be able to prove accesses to slices with constant offsets such as slice[i-10]. Change-Id: I2a63d050ed58258136d54712ac7015b25c893d71 Reviewed-on: https://go-review.googlesource.com/104038 Run-TryBot: Giovanni Bajo <rasky@develer.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/loopbce.go')
-rw-r--r--src/cmd/compile/internal/ssa/loopbce.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/loopbce.go b/src/cmd/compile/internal/ssa/loopbce.go
index a96d98717d..7f2da4870e 100644
--- a/src/cmd/compile/internal/ssa/loopbce.go
+++ b/src/cmd/compile/internal/ssa/loopbce.go
@@ -137,7 +137,7 @@ nextb:
}
}
- if f.pass.debug > 1 {
+ if f.pass.debug >= 1 {
if min.Op == OpConst64 {
b.Func.Warnl(b.Pos, "Induction variable with minimum %d and increment %d", min.AuxInt, inc.AuxInt)
} else {