================ @@ -2927,6 +2928,20 @@ void Verifier::visitFunction(const Function &F) { "Calling convention does not support varargs or " "perfect forwarding!", &F); + if (F.getCallingConv() == CallingConv::PTX_Kernel && + TT.getOS() == Triple::CUDA) { + for (const Argument &Arg : F.args()) { + if (Arg.getType()->isPointerTy()) { + auto AS = Arg.getType()->getPointerAddressSpace(); + Check(AS != NVPTXAS::AddressSpace::ADDRESS_SPACE_SHARED, + ".shared ptr kernel args unsupported in CUDA.", &Arg, &F); ---------------- Artem-B wrote:
I think the check should be rephrased to only allow generic and grlobal AS, and error out on anything else, so we don't have to update it when a new AS is added, or if/when someone uses a nonsensical AS. https://github.com/llvm/llvm-project/pull/138706 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits