FAQ
Since bce happens over different passes you can now use checkbce pass to
debug bounds checks:

% go build -gcflags="-d=ssa/check_bce/debug=1" boundscheck.go
# command-line-arguments
./boundscheck.go:17: Found IsInBounds
./boundscheck.go:22: Found IsSliceInBounds
./boundscheck.go:26: Found IsInBounds
./boundscheck.go:35: Found IsInBounds
./boundscheck.go:71: Found IsInBounds




duminică, 3 aprilie 2016, 21:38:07 UTC+2, Keith Randall a scris:

On Sun, Apr 3, 2016 at 4:08 AM, <klau...@gmail.com <javascript:>> wrote:
On Friday, 1 April 2016 12:04:41 UTC+2, Alexandru Moșoi wrote:

I've updated the doc
<https://docs.google.com/document/d/1vdAEAjYdzjnPA9WDOQ1e4e05cYVMpqSxJYZT33Cqw2g/edit?usp=sharing>
based on the recent compiler improvements.

In particular the following examples are working as expected.

// using a hint
_ = a[3] // early bounds check
use a[1], a[2], a[3] // no bounds checks
This is really great. I already have a few places where this will help,
particularly places like this:


https://github.com/golang/go/blob/master/src/compress/flate/huffman_bit_writer.go#L296

and this:


https://github.com/golang/go/blob/master/src/compress/flate/deflate.go#L273

Great work - I'm looking forward to testing some numbers.

Just a quick question - will the bounds check eliminations show on when
using -ldflags '-m'?

Right now you'll have to use -d=ssa/prove/debug (in -gcflags, not
-ldflags). Maybe we should turn on relevant ssa pass flags when -m is
provided.
/Klaus



--
You received this message because you are subscribed to the Google Groups
"golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-dev+...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 11 of 15 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedMar 17, '16 at 3:08p
activeApr 11, '16 at 2:00a
posts15
users6
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase