[PATCH] D102385: [GlobalISel][IRTranslator] Use preferred alignment when creating frame indices.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 06:22:42 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:263
+  //
+  // FIXME: Do we really want to second-guess the IR in isel?
+  Align Alignment = std::max(std::min(TyPrefAlign, StackAlign), SpecifiedAlign);
----------------
I think the answer is no. You could have a separate pass up-align allocas, and in practice frontends emit them with the preferred alignment to begin with.

For AMDGPU there is no benefit to aligning anything on the stack over 4, and anything more just wastes space. The ABI still requires the higher alignment though, so I would like to have a pass to under align allocas when the alignment isn't visible. I've also long wanted to allow the datalayout to specify a preferred alignment lower than the ABI, but this isn't allowed (D29810 partially addressed this but never went anywhere)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102385



More information about the llvm-commits mailing list