[PATCH] D112001: [Clang] Add min/max reduction builtins.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 18 08:28:48 PDT 2021


fhahn created this revision.
fhahn added reviewers: aaron.ballman, scanon, craig.topper, rjmccall, erichkeane.
fhahn requested review of this revision.
Herald added a project: clang.

This patch implements __builtin_reduce_max and __builtin_reduce_min as
specified in D111529 <https://reviews.llvm.org/D111529>.

The order of operations does not matter for min or max reductions and
they can be directly lowered to the corresponding
llvm.vector.reduce.{fmin,fmax,umin,umax,smin,smax} intrinsic calls.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112001

Files:
  clang/include/clang/Basic/Builtins.def
  clang/include/clang/Sema/Sema.h
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/builtins-elementwise-math.c
  clang/test/Sema/builtins-elementwise-math.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112001.380413.patch
Type: text/x-patch
Size: 8094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211018/e2fd5c24/attachment-0001.bin>


More information about the cfe-commits mailing list