Don't rewrite jumps to empty BBs to landing pads.
authorPete Cooper <peter_cooper@apple.com>
Thu, 30 Apr 2015 18:58:23 +0000 (18:58 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 30 Apr 2015 18:58:23 +0000 (18:58 +0000)
commit1870668beb784a79aae8e37d6e5939e9d2a94f3f
tree07acaef6f598958200a6aa87ba9b4f7b6f3bb209
parent131da40ffdc7ad0a04d6b107b67588697e41b544
Don't rewrite jumps to empty BBs to landing pads.

In the test case here, the 'unreachable' BB was removed by BranchFolding because its empty.

It then rewrote the jump from 'entry' to jump to its fallthrough, which was a landing pad.

This results in 'entry' jumping to 2 different landing pads, which fails the machine verifier.

rdar://problem/20750162

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236248 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BranchFolding.cpp
test/CodeGen/X86/branchfolding-landingpads.ll [new file with mode: 0644]