This patch change the rvv frame layout that proposed in D94465. According to D94465, to eliminate the rvv frame index, create temp virtual register is needed. This virtual register should be scavenged by class RegsiterScavenger. If the machine function has other unused registers, there is no problem. But if there isn't unused registers, we need a emergency spill slot. Because of the emergency spill slot belongs to the scalar local variables field, to access emergency spill slot, we need a temp virtual register again. This makes the compiler report the "Incomplete scavenging after 2nd pass" error. So I change the rvv frame layout as follows:
if use sp or bp as base register:
|--------------------------------------| | arguments passed on the stack | |--------------------------------------|<--- fp | callee saved registers | |--------------------------------------| | rvv vector objects(local variables | | and outgoing arguments | |--------------------------------------| | realignment field | |--------------------------------------| | scalar local variable(also contains| | emergency spill slot) | |--------------------------------------|<--- bp | variable-sized local variables | |--------------------------------------|<--- sp
if use fp as base register:
|--------------------------------------| | arguments passed on the stack | |--------------------------------------|<--- fp | callee saved registers | |--------------------------------------| | scalar local variable(also contains| | emergency spill slot) | |--------------------------------------| | rvv vector objects(local variables | | and outgoing arguments | |--------------------------------------| | variable-sized local variables | |--------------------------------------|<--- sp
This formatting looks weird.