arsenm accepted this revision.
arsenm added a comment.
This revision is now accepted and ready to land.

LGTM with nits



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:533
+  if (!LD)
+    return -1;
+
----------------
hliao wrote:
> tra wrote:
> > Is there a suitable constant for `don't know` result?
> I would say all generic pointers loaded from the constant memory are safe to 
> be assumed as global ones (for AMDGPU). I explained the reason in the usage 
> document. The constant memory could be modified by the host, where only 
> global memory objects are visible.
AMDGPUAS::UNKNOWN_ADDRESS_SPACE


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:540
+  const auto *Ptr = LD->getPointerOperand();
+  if (Ptr->getType()->getPointerAddressSpace() != AMDGPUAS::CONSTANT_ADDRESS)
+    return -1;
----------------
This could be a bit broader but is fine for now


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:541
+  if (Ptr->getType()->getPointerAddressSpace() != AMDGPUAS::CONSTANT_ADDRESS)
+    return -1;
+  // For a generic pointer loaded from the constant memory, it could be assumed
----------------
Ditto


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91121

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to