[PATCH] D99071: [ASAN][AMDGPU] Add support for accesses to global and constant addrspaces

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 28 13:28:14 PDT 2021


vitalybuka added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1380
   Type *PtrTy = cast<PointerType>(Ptr->getType()->getScalarType());
-  if (PtrTy->getPointerAddressSpace() != 0)
+  if (PtrTy->getPointerAddressSpace() != 0 && !TargetTriple.isAMDGPU())
     return true;
----------------
Why can we use isUnsupportedAMDGPUAddrspacehere(PtrTy)?


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1684
+    uint32_t TypeSize, bool IsWrite, Value *SizeArgument) {
+  // Do not instrument unsupported addrspaces
+  if(isUnsupportedAMDGPUAddrspace(Addr)) return nullptr;
----------------
And the rest of the patch.


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1694
+  Value *IsShared = IRB.CreateCall(
+      M->getOrInsertFunction("llvm.amdgcn.is.shared", IRB.getInt1Ty(),
+                             IRB.getInt8PtrTy()),
----------------
Please collect getOrInsertFunction in AddressSanitizer::initializeCallbacks


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

https://reviews.llvm.org/D99071



More information about the llvm-commits mailing list