Switch to select optimization for two-case switches
authorMarcello Maggioni <hayarms@gmail.com>
Tue, 14 Oct 2014 01:58:26 +0000 (01:58 +0000)
committerMarcello Maggioni <hayarms@gmail.com>
Tue, 14 Oct 2014 01:58:26 +0000 (01:58 +0000)
commitdb9fed93fadf083ee1fb6cffcd045ef66adfc820
tree8a9acbe224946bb96349d2bf65053ab82528d1e7
parent07d392bdf2a4149f53318defc9513c2be6d14513
Switch to select optimization for two-case switches

This is the same optimization of r219233 with modifications to support PHIs with multiple incoming edges from the same block
and a test to check that this condition is handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219656 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/UnreachableEliminate.ll
test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll [new file with mode: 0644]
test/Transforms/SimplifyCFG/switch-to-select-two-case.ll [new file with mode: 0644]