cmd/compile: bounds check not needed #61333
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
https://godbolt.org/z/EW16jnEG7
As you can see, there is panicIndex, on s[I + j]. But in golang, for i := 0; I < len(s); I++ doesn't go into panicIndex. Why does
calls panicIndex? There is no need in this. Compiler sees that i + j is always in range [0, len(s)). Easy optimisation, probably not only in this case.
The text was updated successfully, but these errors were encountered: