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)
commit4d8d2ec3ebf2334e8f16b4d702e3e6e6788c4a3e
treec6c3ff497ccb28a80bbe56b7d91b81ed95ade295
parent0a905042cd87017ddf7449d9659dd4fcc17acefe
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

llvm-svn: 236248
llvm/lib/CodeGen/BranchFolding.cpp
llvm/test/CodeGen/X86/branchfolding-landingpads.ll [new file with mode: 0644]