[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
Fri Sep 11 10:40:36 PDT 2020


craig.topper added a comment.

In D87479#2267835 <https://reviews.llvm.org/D87479#2267835>, @spatel wrote:

> In D87479#2266829 <https://reviews.llvm.org/D87479#2266829>, @craig.topper wrote:
>
>> We don't seem to run LICM after InstCombine in the LTO pipeline if I'm reading the pass manager correctly.
>
> That seems like the root bug...although a 1st hack at changing that didn't result in any regression test fails in llvm/test/Other/* .
> If we are inverting this fdiv pattern, then aren't we doing that to all kinds of other loop invariant opportunities too?

We likely are messing up other opportunities, but maybe their cost isn't as high as division so no one has noticed.

The case we spotted this on wasn't with LTO. So maybe we have another problem in our internal pipeline like Julia had.

It also seems to affect vectorization as the PhaseOrder test is showing. And we don't get it right with -fno-unroll-loops. Are those worth fixing?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87479



More information about the llvm-commits mailing list