[PATCH] D96386: [AMDGPU] Fix promote alloca with double use in a same insn

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 12:39:14 PST 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:1004
+    case Intrinsic::memmove:
+      // These have 2 pointer operands. In case if second pointer also needs
+      // to be replaced we defer processing of these intrinsics until all
----------------
In principle this could happen for all multi-operand instructions, like select and icmp


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:1007
+      // other values are processed.
+      DeferredIntrs.push_back(Intr);
       continue;
----------------
I'm not sure I understand why it really needs to be deferred. If we tracked the specific use, you could just replace the one operand and then encounter the instruction again for the second?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:1014-1016
+      if (uint64_t Bytes = Intr->getDereferenceableBytes(1)) {
+        B->addDereferenceableAttr(1, Bytes);
+      }
----------------
This is a separate patch (also more attributes still apply)


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

https://reviews.llvm.org/D96386



More information about the llvm-commits mailing list