[PATCH] D129690: [LLVM][AMDGPU] Specialize 32-bit atomic fadd instruction for generic address space

Shilei Tian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 10:34:31 PDT 2022


tianshilei1992 added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:13014
+  FunctionCallee AddressShared = M->getOrInsertFunction(
+      "llvm.amdgcn.is.shared", Builder.getInt1Ty(), Builder.getInt8PtrTy());
+  Value *IsShared = Builder.CreateCall(AddressShared, {AddrInt8Ptr});
----------------
tianshilei1992 wrote:
> arsenm wrote:
> > tianshilei1992 wrote:
> > > arsenm wrote:
> > > > Should use getIntrinsic with the enum, not refer to the intrinsic by name (or CreateIntrinsic)
> > > Well, I agree, but that intrinsic is not in llvm yet. clang directly lowers the compiler built-in to this. As a result, directly using the name is a WA.
> > Yes it is, the intrinsic wouldn't work at all if it weren't
> It looks like I didn't use `CreateIntrinsic` correctly. It hits the following assertion (llvm/lib/IR/Function.cpp:894):
> ```
>   assert((Tys.empty() || Intrinsic::isOverloaded(Id)) &&
>          "This version of getName is for overloaded intrinsics only");
> ```
> Isn't `Intrinsic::amdgcn_is_shared` the right intrinsic ID?
K, I fixed that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129690



More information about the llvm-commits mailing list