[PATCH] D87479: [InstCombine] Don't sink the fdiv from (fmul (fdiv 1.0, %x), %y) if the fdiv isn't in the same basic block as the fmul

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 14:27:40 PDT 2020


craig.topper added a comment.

In D87479#2266728 <https://reviews.llvm.org/D87479#2266728>, @lebedev.ri wrote:

> In D87479#2266721 <https://reviews.llvm.org/D87479#2266721>, @craig.topper wrote:
>
>> In D87479#2266582 <https://reviews.llvm.org/D87479#2266582>, @lebedev.ri wrote:
>>
>>> When does that happen?
>>> `-O3` seems to be fine: https://godbolt.org/z/1K3r56
>>> Do we have InstCombine invocations after last LICM?
>>
>> We found it in our internal code base so maybe there’s something different about our pipeline.
>
>
>
>> But still seems like we shouldn’t have two passes making opposite choices.
>
> I think this isn't an exception, there's a lot of opposite transforms.

I don't know if it helps, but the last LICM that fixes it is disabled with -fno-unroll-loops https://godbolt.org/z/dxjMxb   Though for this simple case MachineLICM recovers it. But MachineLICM is much weaker than IR LICM on nested loops.


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

https://reviews.llvm.org/D87479



More information about the llvm-commits mailing list