[all-commits] [llvm/llvm-project] 4010a7: Reapply [InstCombine] Support switch in phi to con...
Nikita Popov via All-commits
all-commits at lists.llvm.org
Thu Mar 17 02:03:26 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4010a7a5d0ea21374f3dcab85aa26a9804e1c35d
https://github.com/llvm/llvm-project/commit/4010a7a5d0ea21374f3dcab85aa26a9804e1c35d
Author: Nikita Popov <npopov at redhat.com>
Date: 2022-03-17 (Thu, 17 Mar 2022)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
M llvm/test/Transforms/InstCombine/simple_phi_condition.ll
Log Message:
-----------
Reapply [InstCombine] Support switch in phi to cond fold
Reapply with an explicit check for multi-edges, as the expected
behavior of multi-edge dominance is unclear (D120811).
-----
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