[llvm] [llvm][CodeGen] Intrinsic `llvm.powi/ldexp.*` code gen for vector arguments (PR #118242)
Zhaoxin Yang via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 17:58:26 PST 2024
ylzsx wrote:
> I just noticed you are using vector ldexp with a scalar i32 argument. I'm surprised this is considered valid IR, and works as well as it does. It wasn't my intention when I added the intrinsic to handle that case. I expected the number of elements of both arguments would match. Do you only have this issue when using the implicit splat behavior of the scalar operand? powi is weird because it only takes the scalar argument, unlike ldexp.
>
> I suppose we could support the scalar second argument for ldexp, but I'm not sure we handle implicit splats like that in any other operation.
I didn't notice earlier that the second argument of ldexp can accept vector arguments. In fact, `ldexp` can generate code sequences whether it accepts scalar or vector arguments. The initial issue was only related to `powi` (https://github.com/llvm/llvm-project/issues/118079).
https://github.com/llvm/llvm-project/pull/118242
More information about the llvm-commits
mailing list