[libc-commits] [clang] [libc] RFC: clang, libc: Extend the ext_vector_type attribute to support the scalable vector sizes (PR #183307)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Wed Feb 25 07:21:12 PST 2026
https://github.com/jhuber6 commented:
Nice! I've long hoped that scalable vectors (LLVM's vscale support) could be expressed through clang. There will probably be a lot of subtle stuff here, though.
I'm wondering what `getNumElements` returns here, as it's used in several places in Clang. I don't fully know the vscale interface into LLVM. Would this just return one and it's up to the user to scale it? Do we know if the builtins emit properly for these? Like `__builtin_elementwise_min` or `__builtin_reduce_add` for example.
I don't think a negative number is the most straightforward solution. Could we make a new type that internally is an ExtVector but with the type changed like you've done here? We would probably want to re-use `vscale` in the name since that's what LLVM uses and it's not like there's a standard here.
https://github.com/llvm/llvm-project/pull/183307
More information about the libc-commits
mailing list