[PATCH] D116736: [Clang] Add __builtin_reduce_or and __builtin_reduce_and

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 9 09:48:31 PST 2022


fhahn added reviewers: aaron.ballman, erichkeane.
fhahn added a comment.

LGTM, thanks!

> The last __builtin_reduce_add will be seperated into another one.

Are you planning on putting up a patch for this one as well? What makes add a bit different is that `‘llvm.vector.reduce.fadd.*’` can only perform reductions either in the original order or in an unspecified order. For the extension, we need a particular evaluation order (reduction tree adding adjacent element pairs). Technically this order is required for all reduction builtins, but for integers the order doesn't matter, same for min/max.



================
Comment at: clang/lib/Sema/SemaChecking.cpp:2235
 
-  // __builtin_reduce_xor supports vector of integers only.
-  case Builtin::BI__builtin_reduce_xor: {
+  // This builtins support vector of integers only.
+  case Builtin::BI__builtin_reduce_xor:
----------------
nit: Those .... vectors ....


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116736/new/

https://reviews.llvm.org/D116736



More information about the cfe-commits mailing list