[PATCH] D97514: [SystemZ] Assign the full space for promoted and split outgoing args

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 4 09:45:48 PDT 2021


luismarques added a comment.

Just a heads-up about a possible pitfall of this patch, though I'm not sure it actually affects SystemZ.

In D99068 <https://reviews.llvm.org/D99068> I basically ported this patch to the RISC-V target, as it was affected by the same problem that this patch fixes.
While comparing that patch with an alternative implementation (D99087 <https://reviews.llvm.org/D99087>) it became clear that this approach can produce stack slots with incorrect alignment.
The relevant part of the patch is `SlotVT = EVT::getIntegerVT(Ctx, PartVT.getSizeInBits() * N);`.
An example where it produces wrong results is when the original type fp128, which has 16-byte alignment, becomes i128, which for riscv32 has a lower alignment.
Perhaps more relevant for SystemZ, vectors can also suffer from similar (but even more dramatic) changes in alignment.

Although I had abandoned D99068 <https://reviews.llvm.org/D99068> in favour of D99087 <https://reviews.llvm.org/D99087>, I've updated D99068 <https://reviews.llvm.org/D99068> to address the alignment issues, in case it's useful.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97514/new/

https://reviews.llvm.org/D97514



More information about the llvm-commits mailing list