[all-commits] [llvm/llvm-project] 83a932: [Coroutines] Remove corresponding phi values when ...

Brian Gesiak via All-commits all-commits at lists.llvm.org
Sun Jan 5 15:26:36 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 83a9321f60d837e4d41c9c08c09ab9e4c171ada4
      https://github.com/llvm/llvm-project/commit/83a9321f60d837e4d41c9c08c09ab9e4c171ada4
  Author: Brian Gesiak <modocache at gmail.com>
  Date:   2020-01-05 (Sun, 05 Jan 2020)

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/test/Transforms/Coroutines/coro-split-musttail.ll
    A llvm/test/Transforms/Coroutines/coro-split-musttail1.ll

  Log Message:
  -----------
  [Coroutines] Remove corresponding phi values when apply simplifyTerminatorLeadingToRet

Summary:
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+flto
check-llvm

Reviewers: modocache, GorNishanov, lewissbaker

Reviewed By: modocache

Subscribers: mehdi_amini, EricWF, hiraditya, dexonsmith, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71826

Patch by junparser (JunMa)!




More information about the All-commits mailing list