[SwitchLowering] Handle multiple destinations on condensed case stmts
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 28 Nov 2014 19:47:33 +0000 (19:47 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 28 Nov 2014 19:47:33 +0000 (19:47 +0000)
commit04122090c2dc3447cbc612e97b17950f22d2f46e
tree0c3c0f5b4d6e1a32cb519ee45105538b6948ba5a
parentc5992119fc598a48ed1456c26a61a2a8030744ce
[SwitchLowering] Handle multiple destinations on condensed case stmts

Switch cases statements with sequential values that branch to the same
destination BB may often be handled together in a single new source BB.
In this scenario we need to remove remaining incoming values from PHI
instructions in the destination BB, as to match the number of source
branches.

Differential Revision: http://reviews.llvm.org/D6415

rdar://problem/19040894

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222926 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LowerSwitch.cpp
test/Transforms/Util/lowerswitch.ll