[all-commits] [llvm/llvm-project] 004720: [InstCombine] Simplify boolean Phis with const inp...

max-azul via All-commits all-commits at lists.llvm.org
Wed Jul 15 22:12:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 00472067c34ccbceb2fad4b905524f3c780bb7d5
      https://github.com/llvm/llvm-project/commit/00472067c34ccbceb2fad4b905524f3c780bb7d5
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
    M llvm/test/Transforms/CallSiteSplitting/callsite-split.ll
    M llvm/test/Transforms/InstCombine/branch.ll
    M llvm/test/Transforms/InstCombine/icmp-constant-phi.ll
    M llvm/test/Transforms/InstCombine/phi.ll
    M llvm/test/Transforms/InstCombine/select.ll
    M llvm/test/Transforms/InstCombine/simple_phi_condition.ll
    M llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll

  Log Message:
  -----------
  [InstCombine] Simplify boolean Phis with const inputs using CFG

This patch adds simplification for pattern:
```
  if (cond)
  /       \
 ...      ...
  \       /
p = phi [true] [false]
...
br p, succ_1, succ_2
```
If we can prove that top block's branches dominate respective
inputs of a block that has a Phi with constant inputs, we can
use the branch condition (maybe inverted) instead of Phi.
This will make proofs of implication for further jump threading
more transparent.

Differential Revision: https://reviews.llvm.org/D81375
Reviewed By: xbolva00




More information about the All-commits mailing list