Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Coroutines/Coroutines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ void coro::Shape::invalidateCoroutine(
// present.
for (AnyCoroSuspendInst *CS : CoroSuspends) {
CS->replaceAllUsesWith(PoisonValue::get(CS->getType()));
CS->eraseFromParent();
if (auto *CoroSave = CS->getCoroSave())
CoroSave->eraseFromParent();
CS->eraseFromParent();
}
CoroSuspends.clear();

Expand Down
14 changes: 14 additions & 0 deletions llvm/test/Transforms/Coroutines/coro-split-invalid.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Tests that coro-split correctly invalidate bad coroutines
; RUN: opt < %s -passes='cgscc(coro-split)' -S | FileCheck %s

define void @pr156444() presplitcoroutine {
; CHECK-LABEL: define void @pr156444(
; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: ret void
;
entry:
%0 = call i8 @llvm.coro.suspend(token none, i1 false)
ret void
}
Loading