[PATCH] D152701: LowerMemIntrinsics: Check address space aliasing for memmove expansion

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 22:06:17 PDT 2023


ebrevnov added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp:396
   if (SrcAS != DstAS) {
+    if (!TTI.addrspacesMayAlias(SrcAS, DstAS)) {
+      // We may not be able to emit a pointer comparison, but we don't have
----------------
I would suggest to move this peace of code to the caller to preserve logical structure of the code (createMemMoveLoop suggest to create a mem move not mem copy). Not insisting though... 


================
Comment at: llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp:433
     else {
       // We don't know generically if it's legal to introduce an
       // addrspacecast. We need to know either if it's legal to insert an
----------------
Should the comment be updated?


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

https://reviews.llvm.org/D152701



More information about the llvm-commits mailing list