[clang] [CIR][AMDGPU] Route printf in device code through the OpenCL runtime (PR #226435)
Steffen Larsen via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 28 05:29:43 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);
----------------
steffenlarsen wrote:
See https://github.com/llvm/llvm-project/pull/226435#discussion_r4120789158 - I was of two minds. I'm generally not much for the post-translation cleanup solution, but without an op I don't see much alternative. It has been moved to it though, so let's discuss the option of an Op in the other thread.
https://github.com/llvm/llvm-project/pull/226435
More information about the cfe-commits
mailing list