[PATCH] D151482: [LV] Add support for minimum/maximum intrinsics

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 09:15:12 PDT 2023


dmgreen added inline comments.


================
Comment at: llvm/lib/Analysis/IVDescriptors.cpp:814
+     // minimum and maximum intrinsics do not require nsz and nnan flags since
+     // signed zeroes and NaN are these are supported in the intrinsic
+     // implementation.
----------------
As far as I understand from the language ref, llvm.vector.reduce.fmin will be unspecified for 0.0/-0.0, and will return a value unless all the inputs are Nan. https://llvm.org/docs/LangRef.html#llvm-vector-reduce-fmin-intrinsic. This matches the behaviour of llvm.minnum. llvm.minimum has stronger semantics for signed zero and propagates nans, so would only be valid to convert with fast math flags.

I'm not 100% sure that llvm.minnum would need fast math flags, but llvm.minimum would seem to. Does it sound like I have that the right way around?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151482



More information about the llvm-commits mailing list