[PATCH] D71826: [Coroutines] Remove corresponding phi values when apply simplifyTerminatorLeadingToRet

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 22 23:20:34 PST 2019


junparser created this revision.
junparser added reviewers: modocache, GorNishanov, lewissbaker.
Herald added subscribers: llvm-commits, jfb, dexonsmith, hiraditya, EricWF, mehdi_amini.
Herald added a project: LLVM.

In addMustTailToCoroResumes, we set musttail on those resume instructions that are followed by a ret instruction. This is done by simplifyTerminatorLeadingToRet which replace a sequence of branches leading to a ret with a clone of the ret.

However it forgets to remove corresponding PHI values that come from basic block of replaced branch, and may cause jumpthreading pass hangs (https://bugs.llvm.org/show_bug.cgi?id=43720)

This patch fix this issue

Test Plan:
cppcoro library with O3 <https://reviews.llvm.org/owners/package/3/>+flto
check-llvm


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71826

Files:
  llvm/lib/Transforms/Coroutines/CoroSplit.cpp
  llvm/test/Transforms/Coroutines/coro-split-musttail1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71826.235095.patch
Type: text/x-patch
Size: 5266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191223/e70a9ccf/attachment.bin>


More information about the llvm-commits mailing list