Local memory use (and stack frame use in particular) is not the same as register spilling. Providing storage for register spilling is just one of the uses of the stack frame and thus local memory.
Local memory is used to store thread-local data. All thread-local data is by default allocated in local memory. As an optimization, the compiler will attempt to place some of that data in registers instead. However, registers are a tightly limited resource and cannot be indexed. Arrays have to be both small (as determined by a compiler heuristic) and be accessed exclusively via compile-time constant indexes to be placed into registers. Local arrays that are large (like the one in your code), or have runtime variable indexing must remain in local memory.
In some cases the compiler makes a decision to place a local variable into a register, only to find later that there is insufficient register storage to hold all the variables. In those cases it will temporarily unload the register data for some of these variables to local memory, and reload it from there later. This process is called register spilling, and is a technique commonly used by compilers on both CPUs and GPUs.