[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 06:24:58 PDT 2022


arichardson added a comment.

In D134168#3802424 <https://reviews.llvm.org/D134168#3802424>, @arichardson wrote:

> 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?

I've made this generic in D134282 <https://reviews.llvm.org/D134282> (depends on D134281 <https://reviews.llvm.org/D134281>).


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

https://reviews.llvm.org/D134168



More information about the llvm-commits mailing list