[PATCH] D116058: [InstCombine] Convert binop(phi, v) to phi(binop) for constant phi operands

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 21 14:07:56 PST 2021


Carrot added a comment.

In D116058#3205451 <https://reviews.llvm.org/D116058#3205451>, @nikic wrote:

> This reminds me of the SpeculateAroundPhis pass, see D37467 <https://reviews.llvm.org/D37467> and D104099 <https://reviews.llvm.org/D104099>.

Right, it is used to solve the same problem, but with simpler implementation. The SpeculateAroundPhis pass can handle more complex cases, but most common cases should be covered by this patch.

On the other hand, this patch doesn't have the problem reported in D104099 <https://reviews.llvm.org/D104099> because foldOpIntoPhi doesn't split predecessors.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116058



More information about the llvm-commits mailing list