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)
commit5bbe3df63f4788b42ead0344d431ecd9656d7ced
treef21c06072b1488f3df844eeb07fe8c14ae4dd86b
parent4121bce3f6bcedbcc987c2aa34df3461cb201930
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.

llvm-svn: 219656
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
llvm/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll [new file with mode: 0644]
llvm/test/Transforms/SimplifyCFG/switch-to-select-two-case.ll [new file with mode: 0644]