[PATCH] D128591: Transforms: refactor pow(x, n) expansion where n is a constant integer value

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 09:34:15 PDT 2022


spatel added a comment.

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

> In D128591#3662752 <https://reviews.llvm.org/D128591#3662752>, @eaeltsin wrote:
>
>> BTW, this is not about `-Ofast` - the problem reproduces with `-O1` - https://gcc.godbolt.org/z/6barovn81
>
> Ah, that's definitely a bug. We can't convert pow to powi without some kind of FMF. I thought the transform was still guarded by 'afn', but I see now that there are non-fast tests that changed too.

Fixed to require 'afn':
3d6c10dcf3b5 <https://reviews.llvm.org/rG3d6c10dcf3b5d43708adb0c175e6ff382a4e9e4c>

I'm not sure if that resolves all of the outstanding questions here (and might reopen some of the original motivation for the patch), but it should restore correctness with an `-O1` compile.


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