[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

Simon Pilgrim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 13 08:15:52 PST 2020


RKSimon created this revision.
RKSimon added reviewers: craig.topper, pengfei, spatel.
RKSimon requested review of this revision.
Herald added a project: clang.

As suggested by @pengfei on D92940 <https://reviews.llvm.org/D92940>

My concern with this is that by default llvm.vector.reduce.fmax/min matches the fmaxnum/fminnum behaviour for nan values, which will scalarize on x86. But the existing clang/gcc/icc behaviour is to effectively to treat this as a fastmath vector reduction using the AVX vmaxpd/vminpd ops.

The intel descriptions for these _mm_reduce_* intrinsics is very vague - are we happy to always set these expansions to fast math? Or is this use of the llvm intrinsics a step too far?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93179

Files:
  clang/include/clang/Basic/BuiltinsX86.def
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Headers/avx512fintrin.h
  clang/test/CodeGen/X86/avx512-reduceMinMaxIntrin.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93179.311449.patch
Type: text/x-patch
Size: 15642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201213/edbedc5b/attachment-0001.bin>


More information about the cfe-commits mailing list