getReducedAlign is used by LegalizeTypes to when creating stack
temporaries for some vector operations that can't be easily split
into vectors with fewer elements. For example, insert and extract
elements/subvectors.
Scalable vector stack temporaries do not update the maximum stack
alignment in MachineFunctionInfo. If a scalable vector temporary is
created with alignment larger than the maximum stack alignment and
larger than the 16 byte guaranteed for RISC-V, we will fail to
reserve the frame pointer prior to register allocation. But prologue
epilogue emitter will try to use it to align the stack for the vectors.
Since it wasn't reserved for register allocation, it might be used
for something else before the epilogue.
I've also limited some stack temporaries created by argument lowering
and have added a check to ensure the FP was reserved for regalloc. I'll
probably split that into separate patch, but wanted everything together
for initial discussion.
Fixes PR57939.
clang-format not found in user’s local PATH; not linting file.