Open Jorropo opened 1 year ago
Thanks for the report. Would you be interested in sending a CL?
Would you be interested in sending a CL?
If I find time I'll.
Change https://go.dev/cl/532815 mentions this issue: cmd/compile: delay unsigned strength reduction to late opt
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Compile:
What did you expect to see?
No bound check
What did you see instead?
A bound check is present.
However this:
correctly omits the bound check.
Why is this broken ?
Fails to be picked up by prove because opt rewrites it to something along the lines of:
which it has no idea what to do with.
arr[x % 100]
is specially handled withinternal/ir
.I think a simple enough fix is to delay strength reduction to late opt (except for powers of two since prove knows how to handle theses), this will make it miss the main CSE passes but I don't think it's that bad, there is still lowered cse, need to experiment and see what this yields.