cmd/compile: constant indexing to private array should be folded #43403
Lookup tables are quite common, as in https://golang.org/src/math/bits/bits_tables.go. However none of functions that rely on those tables can be constant folded.
Simplest example is https://go.godbolt.org/z/MhMTqb which compiles to:
If such table is replaced with a string, then the constant folding does work. However, that seems like an ugly hack to have.
The text was updated successfully, but these errors were encountered: