[PATCH] D82072: [InstCombine] Combine select & Phi by same condition

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 23:04:41 PDT 2020


mkazantsev added a comment.

In D82072#2105248 <https://reviews.llvm.org/D82072#2105248>, @nikic wrote:

> I'm probably missing something here, but wouldn't it be possible to phi-translate IfTrue and IfFalse (`Inputs[Pred] = IfTrue->DoPHITranslation(BB, Pred)` etc) and the existing code would already work? Why perform the conversion to a different select first, rather than going directly to the phi? (That should also be more powerful, because it removes the limitation that you need a single value.)


Thanks for pointing that out, I wasn't aware we already have this API. I'll rework the patch using it.


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

https://reviews.llvm.org/D82072





More information about the llvm-commits mailing list