[all-commits] [llvm/llvm-project] 0817ce: [InstCombine] Support switch in phi to cond fold

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Mar 2 03:16:49 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0817ce86b540f909eade6a8d7370e1b47e863a70
      https://github.com/llvm/llvm-project/commit/0817ce86b540f909eade6a8d7370e1b47e863a70
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-03-02 (Wed, 02 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
    M llvm/test/Transforms/InstCombine/simple_phi_condition.ll

  Log Message:
  -----------
  [InstCombine] Support switch in phi to cond fold

For conditional branches, we know the value is i1 0 or i1 1 along
the outgoing edges. For switches we can apply exactly the same
optimization, just with the known values determined by the switch
cases.




More information about the All-commits mailing list