Files
khr@golang.org 9c688e3f4d cmd/compile: don't lift divide instructions out of loops
We can't lift things that might panic out of loops.
(In particular, for divides, out from underneath their divisor==0 check.)

Technically, it's not "things that might panic", but "instructions
that might fault". We have to ensure that we issue those instructions
only after we've checked their preconditions. It would be great if
there was an integer divide instruction that didn't fault on
divisor==0. Then it would be ok to lift it, as we already guarantee
we don't use the result. (I'm presuming here all the archs we support
only have faulting integer divides. If we have nonfaulting divides,
we could use them and revert this CL for that arch.)

Fixes #78892

Change-Id: Ie09d1f3d28ae320f6835730c2debcf0dd3df6a04
Reviewed-on: https://go-review.googlesource.com/c/go/+/769700
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-04-22 06:46:27 -07:00
..
2025-10-29 11:00:23 -07:00
2025-10-29 11:00:23 -07:00
2025-10-29 11:00:23 -07:00
2025-10-29 11:00:23 -07:00