cmd/compile: unnecessary nil pointer check #40108
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
This code generates a nil pointer check on
p
.We don't really need a nil pointer check, as the index is bounded by the bounds check.
We can subsume the nil pointer check into the load.
This would require the nil pointer pass to know that indexes are bounded for indexed loads, so it can prove that the load still occurs in the zero page even with the largest possible index.
Maybe we need to keep some information from the prove pass around somehow?
The text was updated successfully, but these errors were encountered: