mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-15 20:26:36 +00:00
fix PR13339 (remove the predecessor from the unwind BB when removing an invoke)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160325 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7e733eab2f
commit
d49981a9bb
@ -165,6 +165,7 @@ static bool MarkAliveBlocks(BasicBlock *BB,
|
|||||||
if (II->use_empty() && II->onlyReadsMemory()) {
|
if (II->use_empty() && II->onlyReadsMemory()) {
|
||||||
// jump to the normal destination branch.
|
// jump to the normal destination branch.
|
||||||
BranchInst::Create(II->getNormalDest(), II);
|
BranchInst::Create(II->getNormalDest(), II);
|
||||||
|
II->getUnwindDest()->removePredecessor(II->getParent());
|
||||||
II->eraseFromParent();
|
II->eraseFromParent();
|
||||||
} else
|
} else
|
||||||
ChangeToCall(II);
|
ChangeToCall(II);
|
||||||
|
@ -3,6 +3,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
|
|||||||
|
|
||||||
declare i32 @__gxx_personality_v0(...)
|
declare i32 @__gxx_personality_v0(...)
|
||||||
declare void @__cxa_call_unexpected(i8*)
|
declare void @__cxa_call_unexpected(i8*)
|
||||||
|
declare void @purefn() nounwind readnone
|
||||||
declare i32 @read_only() nounwind readonly
|
declare i32 @read_only() nounwind readonly
|
||||||
declare i32 @nounwind_fn() nounwind
|
declare i32 @nounwind_fn() nounwind
|
||||||
declare i32 @fn()
|
declare i32 @fn()
|
||||||
@ -115,3 +116,24 @@ lpad:
|
|||||||
tail call void @__cxa_call_unexpected(i8* %phi2) noreturn nounwind
|
tail call void @__cxa_call_unexpected(i8* %phi2) noreturn nounwind
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK: @f6
|
||||||
|
define void @f6() {
|
||||||
|
entry:
|
||||||
|
invoke void @purefn()
|
||||||
|
to label %invoke.cont1 unwind label %lpad
|
||||||
|
|
||||||
|
invoke.cont1:
|
||||||
|
%foo = invoke i32 @fn()
|
||||||
|
to label %invoke.cont2 unwind label %lpad
|
||||||
|
|
||||||
|
invoke.cont2:
|
||||||
|
ret void
|
||||||
|
|
||||||
|
lpad:
|
||||||
|
; CHECK-NOT: phi
|
||||||
|
%tmp = phi i8* [ null, %invoke.cont1 ], [ null, %entry ]
|
||||||
|
landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
|
||||||
|
cleanup
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user