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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 01:03:32 PDT 2020


mkazantsev created this revision.
mkazantsev added reviewers: xbolva00, spatel, lebedev.ri, nikic.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
mkazantsev added a parent revision: D82005: [InstCombine] Replace selects with Phis.
mkazantsev added a child revision: D81375: [InstCombine] Simplify boolean Phis with const inputs using CFG.

This patch transforms

  p = phi [x, y]
  s = select cond, z, p

with

  s = phi[x, z]

if we can prove that the Phi node takes values basing on selec's condition.


https://reviews.llvm.org/D82072

Files:
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82072.271597.patch
Type: text/x-patch
Size: 5182 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200618/6883e435/attachment.bin>


More information about the llvm-commits mailing list