[PATCH] D81375: [InstCombine] Simplify boolean Phis with const inputs using CFG

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 01:34:54 PDT 2020


mkazantsev added a comment.

In D81375#2096608 <https://reviews.llvm.org/D81375#2096608>, @nikic wrote:

> Why is this being limited to phis used in ret and br?


There is a problem with selects:

    if (cond)
    /       \
   ...      ...
    \       /
  p = phi [true] [false]
  s = select p, v1, v2

The way how InstCombine currently works will turn it into

    if (cond)
    /       \
   ...      ...
    \       /
  s = select cond, v1, v2

instead of

    if (cond)
    /       \
   ...      ...
    \       /
  s = phi [v1] [v2]

This limitation is temporarily, until we know how to fix this (and maybe other similar) cases.


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

https://reviews.llvm.org/D81375





More information about the llvm-commits mailing list