[llvm] [SPIR-V] Fix type mismatch in scalar-to-vector promotion for mixed-type builtins (PR #190969)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 13 05:38:11 PDT 2026
aobolensk wrote:
> Just to test my understanding of the underlying issue and the fix, a few questions.
>
> > When promoting scalar arguments to vectors for builtins like ldexp, pown, and rootn, use the correct vector type matching the argument element type instead of always using the return type: these builtins take an integer argument but at the same time have floating point return type
>
> Let's use `floatn pown(floatn x, intn y)` as example. The integer argument is `y`, and we need to also promote it to vector, but prior to this patch, because the return type is `floatn`, the `intn` type didn't exist, and we wouldn't be able to properly promote `intn` to vector. Is my understanding correct?
Yes, in the original implementation it tries to promote it to vector of floats (according to builtin return type, not arg type)
https://github.com/llvm/llvm-project/pull/190969
More information about the llvm-commits
mailing list