[Clang] Add integer mul reduction builtin
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 9 May 2022 10:53:27 +0000 (11:53 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 9 May 2022 11:12:53 +0000 (12:12 +0100)
commit8a92c45e07dc81c83ca3afda3971d98c512429d4
treec23f17f08fa7579ca9d7311bb919885495e33d21
parent12cb540529e41d12cf27d2e716a384b6692563a8
[Clang] Add integer mul reduction builtin

Similar to the existing bitwise reduction builtins, this lowers to a llvm.vector.reduce.mul intrinsic call.

For other reductions, we've tried to share builtins for float/integer vectors, but the fmul reduction intrinsic also take a starting value argument and can either do unordered or serialized, but not reduction-trees as specified for the builtins. However we address fmul support this shouldn't affect the integer case.

Differential Revision: https://reviews.llvm.org/D117829
clang/docs/LanguageExtensions.rst
clang/include/clang/Basic/Builtins.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins-reduction-math.c
clang/test/Sema/builtins-reduction-math.c