[Mlir-commits] [mlir] [mlir][GPUToNVVM] enable fallback to generic LLVM lowering for math dialect in convert-gpu-to-nvvm pass (PR #165728)
Fabian Mora
llvmlistbot at llvm.org
Thu Oct 30 09:18:31 PDT 2025
fabianmcg wrote:
> Thanks! Could you please elaborate a bit more why it's not recommended to use it in production? In fact I'm seeing this pass in some projects' production code.
Sure. First some context, many of the conversion passes (I'm not talking about the patterns, just the passes) were created to help people downstream understand how to create their pipelines and passes (ie, not meant to be used directly). Testing upstream was also an important point in their creation.
The difference with `convert-to-llvm` is that it was specifically introduced to create a production level conversion pass that users could use.
Now, let me give more rationale behind why they're not meant to be in production. Lets assume that one has more `convert-*-to-llvm` passes in the pipeline, in such case you're invoking the dialect conversion infrastructure (which is a heavy infra), many times (in many cases with almost the same patterns), thus creating huge overheads in compilation time in the pipeline. Moreover, in many cases the conversion passes have many opinions on what to run (for example, I might want to error out if a math op couldn't be converted to an NVVM intrinsic, instead of going to llvm).
Consequently, the recommended approach has been: "build your own conversion pass" which won't have the drawbacks I mentioned above, as you decide which patterns to include all in one go (convert-to-llvm can in many cases do this).
https://github.com/llvm/llvm-project/pull/165728
More information about the Mlir-commits
mailing list