Skip to content

Commit

Permalink
[LoweringUtils] Fixed processing of exception-handling code in nested…
Browse files Browse the repository at this point in the history
… tasks generated by -O0. This patch addresses issue llvm#85.
  • Loading branch information
neboat committed Jun 12, 2022
1 parent 305321a commit bcbfa8d
Show file tree
Hide file tree
Showing 2 changed files with 6,271 additions and 5 deletions.
11 changes: 6 additions & 5 deletions llvm/lib/Transforms/Tapir/LoweringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,13 @@ Instruction *llvm::fixupHelperInputs(
return StorePt;
}

/// Returns true if BasicBlock \p B is the immediate successor of a
/// detached-rethrow instruction.
/// Returns true if BasicBlock \p B is the immediate successor of only
/// detached-rethrow instructions.
bool llvm::isSuccessorOfDetachedRethrow(const BasicBlock *B) {
for (const BasicBlock *Pred : predecessors(B))
if (isDetachedRethrow(Pred->getTerminator()))
return true;
return false;
if (!isDetachedRethrow(Pred->getTerminator()))
return false;
return true;
}

/// Collect the set of blocks in task \p T. All blocks enclosed by \p T will be
Expand All @@ -345,6 +345,7 @@ void llvm::getTaskBlocks(Task *T, std::vector<BasicBlock *> &TaskBlocks,
if (isSuccessorOfDetachedRethrow(B))
continue;

DEBUG(dbgs() << "Adding task block " << B->getName() << "\n");
TaskBlocks.push_back(B);

// Record the blocks terminated by reattaches and detached rethrows.
Expand Down

0 comments on commit bcbfa8d

Please sign in to comment.