[clang] [CIR][AMDGPU] Route printf in device code through the OpenCL runtime (PR #226435)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 05:06:31 PDT 2026


================
@@ -65,8 +65,12 @@ lowerFromCIRToLLVMIR(mlir::ModuleOp MLIRModule, llvm::LLVMContext &LLVMCtx,
                      bool EnableOpenMP,
                      llvm::StringRef mlirSaveTempsOutFile = {},
                      llvm::vfs::FileSystem *fs = nullptr) {
-  return direct::lowerDirectlyFromCIRToLLVMIR(MLIRModule, LLVMCtx, EnableOpenMP,
-                                              mlirSaveTempsOutFile, fs);
+  std::unique_ptr<llvm::Module> LLVMModule =
+      direct::lowerDirectlyFromCIRToLLVMIR(MLIRModule, LLVMCtx, EnableOpenMP,
+                                           mlirSaveTempsOutFile, fs);
+  if (LLVMModule)
+    direct::expandAMDGPUDevicePrintf(*LLVMModule);
----------------
Fznamznon wrote:

Why does it happen after `lowerDirectlyFromCIRToLLVMIR` but not during it?

https://github.com/llvm/llvm-project/pull/226435


More information about the cfe-commits mailing list