OSDN Git Service

SimplifyCFG: Correctly handle switch lookup tables which fully cover the input type...
authorHans Wennborg <hans@hanshq.net>
Fri, 24 Apr 2015 20:57:56 +0000 (20:57 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 24 Apr 2015 20:57:56 +0000 (20:57 +0000)
commit7a301c1b8c96770cc946a128b41d79402354fe3f
treea532a7a0e9a149bf0fe6805bc9da11aee0bd2a32
parentaf8df399e1e5b01691de5edf42f09d4d8b308251
SimplifyCFG: Correctly handle switch lookup tables which fully cover the input type and use bit tests to check for holes

When using bit tests for hole checks, we call AddPredecessorToBlock to give the
phi node a value from the bit test block. This would break if we've
previously called removePredecessor on the default destination because the
switch is fully covered.

Test case by Mark Lacey.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235771 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll