[clang][AArch64][SVE] Avoid going through memory for fixed/scalable predicate casts
authorBradley Smith <bradley.smith@arm.com>
Mon, 26 Jul 2021 10:34:08 +0000 (10:34 +0000)
committerBradley Smith <bradley.smith@arm.com>
Wed, 4 Aug 2021 16:10:37 +0000 (16:10 +0000)
commite57e1e4e00264b77b2b35ad2bf419a48aecdd6bc
tree85a0a4a20e1faed7eb6a1b0dc7835016dacaacd9
parent66d4430492131a2205f159071c15e90c10e2fced
[clang][AArch64][SVE] Avoid going through memory for fixed/scalable predicate casts

For fixed SVE types, predicates are represented using vectors of i8,
where as for scalable types they are represented using vectors of i1. We
can avoid going through memory for casts between these by bitcasting the
i1 scalable vectors to/from a scalable i8 vector of matching size, which
can then use the existing vector insert/extract logic.

Differential Revision: https://reviews.llvm.org/D106860
clang/lib/CodeGen/CGCall.cpp
clang/lib/CodeGen/CGExprScalar.cpp
clang/test/CodeGen/attr-arm-sve-vector-bits-bitcast.c
clang/test/CodeGen/attr-arm-sve-vector-bits-call.c
clang/test/CodeGen/attr-arm-sve-vector-bits-cast.c
clang/test/CodeGen/attr-arm-sve-vector-bits-codegen.c
clang/test/CodeGen/attr-arm-sve-vector-bits-globals.c