[Mlir-commits] [mlir] [mlir][math] Fix intrinsic conversions to LLVM for 0D-vector types (PR #141020)
Artem Gindinson
llvmlistbot at llvm.org
Wed May 28 04:38:04 PDT 2025
AGindinson wrote:
@banach-space All very good points, thanks. I'll go forth with implementing and/or clarifying the TODOs.
> Just to double-check - does `builtin.unrealized_conversion_cast` work in your E2E flow?
It does, luckily :)
> I realise you’re following the precedent set by the LLVM type converter
That's a neat way to decompose this, because my current approach is essentially deferring the work to the LLVM TypeConverter. And when we turn to the general matter, do any dialects/pipelines have an argument for maintaining the scalars in 1-d vector form _at the LLVM level_? Because if not, the next, presumably non-controversial step, would be to propose a change in the core converter.
I realize this wouldn't alleviate the need to explicitly handle 0-d vectors in each individual dialect (might even break some "manual" lowering patterns - need to check & see if the fixes are expensive), but that could hardly be a regression from the current state.
(*) E.g. even if some wanted to convert the LLVM dialect back into a higher-level one that would somehow _really benefit_ from 0d vectors, they'd need to infer these semantics from `vector<1xT>` anyhow by looking at memory effects? At the end of the day, the pseudo-vectors will get conflated with either scalars or actual 1-elt vectors.
https://github.com/llvm/llvm-project/pull/141020
More information about the Mlir-commits
mailing list