]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: compute XOR's limits from argument's limits
authorJorropo <jorropo.pgm@gmail.com>
Fri, 9 Aug 2024 13:45:39 +0000 (15:45 +0200)
committerKeith Randall <khr@golang.org>
Tue, 3 Sep 2024 17:12:49 +0000 (17:12 +0000)
commit49621cc311a41b71f60f03202f3872c0633cac59
tree56612663952081bbad6db8ebd4e1ebbecbb88d93
parent9a4fe7e14a4f71267f929c5545916f9830a89187
cmd/compile: compute XOR's limits from argument's limits

This help to optimize code like this:

  func f(buckets *[512]bucket, v value) {
    a, b := v.computeSomething()
    // assume a and b are proved < 512
    b := &buckets[a ^ b] // pick a random bucket
    b.store(v)
  }

Change-Id: I1acf702f5a8137f9ded49081b4703922879b0288
Reviewed-on: https://go-review.googlesource.com/c/go/+/604455
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/ssa/prove.go
test/prove.go