[PATCH] D134168: [RISCV] Make preferred alignment of PointerArgs for MemIntrinsic

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 03:32:06 PDT 2022


arichardson requested changes to this revision.
arichardson added a comment.
This revision now requires changes to proceed.

It looks like this hook is only used by codegenprepare, so the test should be in llvm/test/Transforms/CodeGenPrepare and check that the alignment of the IR variable was changed rather than indirectly testing it via assembly code. I'd also add a version with an alloca.

Additionally, I don't think this should be specific to RISC-V, I would assume that all architectures that don't have unaligned accesses (and even those with slower accesses) would benefit from aligning global string constants that are used in memcpy operations. I see that right now this hook is only used by ARM targets (D7908 <https://reviews.llvm.org/D7908>).

Can this be changed to call `allowsMisalignedMemoryAccesses()` and adjusting the alignment to the size of pointers?


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

https://reviews.llvm.org/D134168



More information about the llvm-commits mailing list