Commit 04f1b65c authored by Michael Munday's avatar Michael Munday
Browse files

cmd/compile: try and access last argument first in rulegen

This reduces the number of extra bounds check hints we need to
insert. For example, rather than producing:

	_ = v.Args[2]
	x := v.Args[0]
	y := v.Args[1]
	z := v.Args[2]

We now produce:

	z := v.Args[2]
	x := v.Args[0]
	y := v.Args[1]

This gets rid of about 7000 lines of code from the rewrite rules.

Change-Id: I1291cf0f82e8d035a6d65bce7dee6cedee04cbcd
Reviewed-on: https://go-review.googlesource.com/c/go/+/167397


Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 5d4fa147
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment