================
@@ -199,6 +287,40 @@ class AMDGPUPrintfLowering {
 
 } // namespace
 
+bool isAMDGPUPrintfModule(mlir::ModuleOp module) {
+  llvm::StringRef tripleStr;
+  if (auto tripleAttr = module->getAttrOfType<mlir::StringAttr>(
+          cir::CIRDialect::getTripleAttrName()))
+    tripleStr = tripleAttr.getValue();
+  llvm::Triple triple(tripleStr);
+  return triple.isAMDGCN() ||
+         (triple.isSPIRV() && triple.getVendor() == llvm::Triple::AMD);
+}
+
+void annotateAMDGPUPrintfStrings(mlir::ModuleOp module,
----------------
steffenlarsen wrote:

I think this is common naming around the codebase currently, but I suspect 
eventually `module` might become a problematic variable name.

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

Reply via email to