[PATCH] D119965: [LICM][PhaseOrder] Don't speculate in LICM until after running loop rotate

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 2 02:45:14 PDT 2022


lebedev.ri added a comment.

In D119965#3423795 <https://reviews.llvm.org/D119965#3423795>, @Carrot wrote:

> In D119965#3423713 <https://reviews.llvm.org/D119965#3423713>, @lebedev.ri wrote:
>
>> If this is really as simple as all the incoming values being identical instructions with identical arguments, then it seems like a simple extension of the `InstCombinerImpl::foldPHIArgOpIntoPHI()`
>
> foldPHIArgOpIntoPHI requires all operands are used by PHI only. In our case or instruction in BB3 has other users.

There are two ways to view this;

1. if all of the IV's of PHI are fully identical instructions with fully identical operands, then we don't need to PHI together the operands, and can replace the PHI with said instruction.
2. The one-user check there is there to ensure that the instruction count does not increase, so in principle, if we need to PHI together the operands, we need as many of the instructions to be one-user as many PHI's we need.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119965



More information about the llvm-commits mailing list