================
@@ -1634,11 +1645,151 @@ void LoweringPreparePass::runOnOp(mlir::Operation *op) 
{
       globalCtorList.emplace_back(fnOp.getName(), globalCtor.value());
     else if (auto globalDtor = fnOp.getGlobalDtorPriority())
       globalDtorList.emplace_back(fnOp.getName(), globalDtor.value());
+
+    if (auto attr = fnOp->getAttr(cir::CUDAKernelNameAttr::getMnemonic())) {
+      auto kernelNameAttr = dyn_cast<CUDAKernelNameAttr>(attr);
+      std::string kernelName = kernelNameAttr.getKernelName();
+      cudaKernelMap[kernelName] = fnOp;
+    }
   } else if (auto threeWayCmp = dyn_cast<cir::CmpThreeWayOp>(op)) {
     lowerThreeWayCmpOp(threeWayCmp);
   }
 }
 
+static std::string getCUDAPrefix(clang::ASTContext *astCtx) {
----------------
andykaylor wrote:

```suggestion
static StringRef getCUDAPrefix(clang::ASTContext *astCtx) {
```

https://github.com/llvm/llvm-project/pull/187636
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to