[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)
commitbc7ba2c7667b8b5b5563b3b1429ca70468d0f251
tree5bad17ad33055be0b1989b29d11068b577196440
parente57f3c0a4235573d824e18b01799e6a8e21a6f22
[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

llvm-svn: 222926
llvm/lib/Transforms/Utils/LowerSwitch.cpp
llvm/test/Transforms/Util/lowerswitch.ll