This is an archive of the discontinued LLVM Phabricator instance.

[clang] Support elementwise builtin for sizeless vector type
Needs ReviewPublic

Authored by jacquesguan on Aug 21 2023, 8:23 PM.

Diff Detail

Event Timeline

jacquesguan created this revision.Aug 21 2023, 8:23 PM
jacquesguan requested review of this revision.Aug 21 2023, 8:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 21 2023, 8:23 PM

remove unused cases

paulwalker-arm added inline comments.Aug 24 2023, 2:51 AM
clang/test/CodeGen/aarch64-sve-vector-elementwise-ops.c
128–131

These should be smin rather than umin?

208–210

This highlights a potential sticking point because can we code generate such intrinsics for scalable vectors? LoopVectorize will emit calls to a vector math library rather than call this intrinsic directly. There's also the replace-with-veclib pass that will convert such intrinsics, again only if there's a suitable math library available.

Is it a good idea to allow builtins that we know will cause a code generation failure? Or might result in a scalarised implementation?

clang/test/Sema/riscv-rvv-vector-elementwise.c