llvm-project
a69a9514 - [Hexagon] Emit PS_aligna in the prologue with the final stack alignment (#204660)

Commit
81 days ago
[Hexagon] Emit PS_aligna in the prologue with the final stack alignment (#204660) Hexagon uses PS_aligna to set up the aligned stack base register when a function has variable-sized stack objects. That pseudo is created during instruction selection using the maximum stack alignment known at that point. Register allocation can later introduce HVX spill slots with stricter alignment, for example 128-byte alignment in HVX 128-byte mode. If PS_aligna keeps the older immediate, the aligned base register can be under-aligned, and aligned HVX spill stores may address stack slots with insufficient alignment. In order to address this bug, insert PS_aligna during prologue emission once its final value is known instead of manually updating it throughout the backend multiple times.
Author
Parents
Loading