diff options
| author | Ilya Tocar <ilya.tocar@intel.com> | 2016-08-24 17:57:01 +0300 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2026-04-06 16:36:04 -0700 |
| commit | f9f351b130d10ea1623ac0423d3ca9e4b07e3502 (patch) | |
| tree | 40b59ae4066b5a717669e8c7cd3f041e6b51a5e2 /src/runtime | |
| parent | 0d0799f055dcc9b3b41df74bee3fbe398ae2f0e7 (diff) | |
| download | go-f9f351b130d10ea1623ac0423d3ca9e4b07e3502.tar.xz | |
cmd/compile: add loop invariant code motion
(I copied Ilya Tocar's CL 27656 and heavily modified it.)
This adds an optimization that moves loop invariant computations
out of the loop. For example:
a:= ...
for ... {
b:= a + 15
// uses of b
}
Turns into
a:= ...
b:= a + 15
for ... {
// uses of b
}
Change-Id: I36c8c7e2b3bc1c5e6b4b293bed3a76dc20d6c825
Reviewed-on: https://go-review.googlesource.com/c/go/+/697235
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions
