This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Limit alignment of stack temporary used for indirect passing of scalable vectors.
Changes PlannedPublic

Authored by craig.topper on Oct 13 2022, 10:32 AM.

Details

Summary

Don't align it more than the stack alignment. If we do, we'll need
to use a frame pointer to align the stack in prologue/epilogue emission.

Creating a stack temporary for a scalable vector doesn't update the
max alignment in MachineFrameInfo, so we won't know we need to align
the stack in time to reserve the FP register from register allocation.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 13 2022, 10:32 AM
craig.topper requested review of this revision.Oct 13 2022, 10:32 AM

Does anything in the callee expect/rely on the alignment? I'm wondering if it's possible that a caller with one subtarget uses a lower alignment than its callee with another subtarget, causing issues.

Does anything in the callee expect/rely on the alignment? I'm wondering if it's possible that a caller with one subtarget uses a lower alignment than its callee with another subtarget, causing issues.

Good catch. I think the load created in LowerFormalArguments uses the ABI align.

craig.topper planned changes to this revision.Oct 14 2022, 8:13 AM