Permalink
Browse files

cmd/compile: eliminate some bounds checks from generated rewrite rules

Noticed while looking at #20356.

Cuts 160k (1%) off of the cmd/compile binary.

Change-Id: If2397bc6971d6be9be6975048adecb0b5efa6d66
Reviewed-on: https://go-review.googlesource.com/43501
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
  • Loading branch information...
josharian committed May 15, 2017
1 parent 4b0d74f commit 5548f7d5cfadf1319a99b2a17e72ff91fcdd09fc
@@ -442,6 +442,9 @@ func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, t
}
}
if n := len(args); n > 1 {
fmt.Fprintf(w, "_ = %s.Args[%d]\n", v, n-1) // combine some bounds checks
}
for i, arg := range args {
if arg == "_" {
continue
Oops, something went wrong.

0 comments on commit 5548f7d

Please sign in to comment.