[clang] [Clang] Add float type support to __builtin_reduce_add and __builtin_reduce_multipy (PR #120367)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 18 09:21:05 PST 2024
================
@@ -1754,6 +1755,17 @@ static bool interp__builtin_vector_reduce(InterpState &S, CodePtr OpPC,
PrimType ElemT = *S.getContext().classify(ElemType);
unsigned NumElems = Arg.getNumElems();
+ if (ElemType->isRealFloatingType()) {
+ if (ID != Builtin::BI__builtin_reduce_add &&
+ ID != Builtin::BI__builtin_reduce_mul)
+ llvm_unreachable("Only reduce_add and reduce_mul are supported for "
----------------
llvm-beanz wrote:
Is this actually unreachable? You have a mix of both real error handling code and an unreachable. Code after an unreachable (like the return) can be removed by a compiler, which would cause some bad behavior here if this ever got hit.
https://github.com/llvm/llvm-project/pull/120367
More information about the cfe-commits
mailing list