[llvm] [Lint][AMDGPU] No store to const addrspace (PR #109181)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 21 08:43:48 PDT 2024


================
@@ -401,6 +403,10 @@ void Lint::visitMemoryReference(Instruction &I, const MemoryLocation &Loc,
         "Unusual: Address one pointer dereference", &I);
 
   if (Flags & MemRef::Write) {
+    if (TT.isAMDGPU())
+      Check(!AMDGPU::isConstantAddressSpace(UnderlyingObject->getType()->getPointerAddressSpace()),
----------------
shiltian wrote:

Is it possible or better to do the check via TTI? I'm not sure if it's a good idea to do the check based on triple.

https://github.com/llvm/llvm-project/pull/109181


More information about the llvm-commits mailing list