[PATCH] D128591: Transforms: Relax restrictions on pow(x, y) expansion

Paul Osmialowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 4 06:05:29 PDT 2022


pawosm01 added a comment.

In D128591#3620079 <https://reviews.llvm.org/D128591#3620079>, @spatel wrote:

> The patch description and tests don't match what the code does currently. We don't require full 'fast'; we just check for 'afn' and propagate that flag to the new instructions.
>
> It might help to know what the motivating source case looks like - are we translating the source-level parameters to FMF as expected?
>
> I'm not opposed to easing the restriction, but it's probably better to add/modify the tests first. That way, we know exactly what the current behavior is and how it will change with the proposed patch.

@spatel we have discussed your comment here, and my understanding is that you're not opposing to the proposed change as such, I guess what you wanted to know is how we ended up with proposed set of flags. At the time of our experiments, we were focused on trying to restrict certain optimizations to the lowest possible set of fast math flags. We were comparing with what Intel compiler can do by default at `-O3` as it is more relaxed than clang, so we wanted to find a route to getting similar effect.

As such I'm finding the test case presented here fitting to the nature of our experiment and I don't see anything missing. Maybe it is quite academic and many may not find a huge benefit of that; in the end, it is sufficient to use `-funsafe-math-optimizations` flag in order to relax restrictions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128591



More information about the llvm-commits mailing list