[Mlir-commits] [mlir] [mlir][GPU] gpu.printf: Do not emit duplicate format strings (PR #110504)

Matthias Springer llvmlistbot at llvm.org
Mon Sep 30 07:00:46 PDT 2024


matthias-springer wrote:

> Side comment: I kind of concerned that it iterates over all globals for each printf making it `O(N^2)` pass. Can we build a map once and reuse it? I do not want to block anyone either, so we can do it in separate PR.

There are two options to do that:
1. Pass a `DenseMap` object to `populateGpuToNVVMConversionPatterns`. Not ideal.
2. Store the cache directly in the lowering pattern. `matchAndRewrite` is a `const` function, so I would have to mark the cache as `mutable`. Not sure if that's ideal either.

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


More information about the Mlir-commits mailing list