Skip to content

Commit

Permalink
[InlineFunction] Fix bug with unifying resume instructions when inlin…
Browse files Browse the repository at this point in the history
…ing a function that can spawn.
  • Loading branch information
neboat committed Feb 17, 2021
1 parent 3baa4ce commit b1f9670
Show file tree
Hide file tree
Showing 2 changed files with 7,796 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Transforms/Utils/InlineFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2530,7 +2530,8 @@ llvm::InlineResult llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
Caller->getContext(), "eh.unified.resume.i", Caller);
// Add a PHI node at the beginning of the block.
IRBuilder<> Builder(UnifiedResume);
PHINode *PN = Builder.CreatePHI(Resumes[0]->getType(), Resumes.size());
PHINode *PN =
Builder.CreatePHI(Resume->getValue()->getType(), Resumes.size());
for (ResumeInst *RI : Resumes) {
// Insert incoming values to the PHI node.
PN->addIncoming(RI->getValue(), RI->getParent());
Expand Down
7,794 changes: 7,794 additions & 0 deletions llvm/test/Transforms/Tapir/inline-unify-resume.ll

Large diffs are not rendered by default.

0 comments on commit b1f9670

Please sign in to comment.