[PATCH] D104796: [AMDGPU] Check for pointer operand while refining LDS align

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 11:07:09 PDT 2021


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:352-353
       if (auto *AI = dyn_cast<AtomicRMWInst>(U)) {
-        AI->setAlignment(std::max(A, AI->getAlign()));
+        // None of atomicrmw operations can work on pointers, but let's
+        // check it anyway in case it will or we will process ConstantExpr.
+        if (AI->getPointerOperand() == Ptr)
----------------
foad wrote:
> You look through bitcasts, so "Ptr" does not necessarily have pointer type, so you really do need this check.
A bitcast cannot convert pointer to a non-pointer, and I am not handling ptrtoint.


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

https://reviews.llvm.org/D104796



More information about the llvm-commits mailing list