[PATCH] D95452: [LoopVectorize] use IR fast-math-flags exclusively (not function attributes)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 07:17:00 PST 2021


spatel added a comment.

In D95452#2523757 <https://reviews.llvm.org/D95452#2523757>, @dmgreen wrote:

> Should InductionDescriptor::hasUnsafeAlgebra be using isFast, or can it be something more precise? Just reassoc or does it need NoNan for some reason? Any others like NoInf?

Good question - if we want to be more precise (and we do!), it will depend on the type of induction (`RecurKind`). I'd make that a follow-up patch to reduce change/risk.
For fmul/fadd, we should require `reassoc` and to be safer `nsz` (I don't think `nnan` is actually necessary because `reassoc` covers that). 
For fmin/fmax, we should require `nnan` and `nsz`. We may want to update the variable naming to better indicate exactly what we mean by "UnsafeAlgebra" - that's a leftover from before the creation of FMF I think.
There's an additional complication for fmin/fmax in that we don't have a complete story for FMF propagation on fcmp/select yet. We'll probably need to mildly hack around that to preserve existing optimizations.


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

https://reviews.llvm.org/D95452



More information about the llvm-commits mailing list