This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Ensure the entire stack is aligned to the RVV stack alignment
ClosedPublic

Authored by frasercrmck on May 19 2022, 7:04 AM.

Details

Summary

This patch fixes another bug in the RVV frame lowering. While some frame
objects with non-default stack IDs (such scalable-vector alloca
instructions) are considered in the target-independent max alignment
calculations, others (for example, during calling-convention lowering)
are not. This means we'd occasionally align the base of the stack to
only 16 bytes, with no way to ensure that the RVV section contained
within that is aligned to anything higher.

Diff Detail

Event Timeline

frasercrmck created this revision.May 19 2022, 7:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2022, 7:04 AM
frasercrmck requested review of this revision.May 19 2022, 7:04 AM

While this bug is reproducible on main, there's no way to properly fix the codegen without D125787 as we lack the ability to ensure RVV alignment beyond 8, and we don't need to ensure an alignment of 8 as we get that for free. So I thought it better to base this patch on D125787.

This revision is now accepted and ready to land.May 20 2022, 7:56 AM
This revision was landed with ongoing or failed builds.May 23 2022, 11:09 PM
This revision was automatically updated to reflect the committed changes.