[PATCH] D87817: [LICM][Coroutine] Don't sink stores to coroutine suspend point.

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 19:05:33 PDT 2020


junparser added a comment.

sorry for the late reply.



================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:400
+
+        if (auto *SWI = dyn_cast<SwitchInst>(PredBB->getTerminator())) {
+          IntrinsicInst *II = dyn_cast<IntrinsicInst>(SWI->getCondition());
----------------
efriedma wrote:
> Is there any particular reason to expect the edge from the coro_suspend to the coro_end is a switch?
The result of this coro.suspend lead to basic blocks where coroutine should proceed when suspended (-1), resumed (0) or destroyed (1). we also generate switch from front end. 

Although sometimes  it would be optimized to conditional branch because of that both of resumed and destroyed case lead to the same basic block. since we are inside loop, the resumed basic block and destroyed basic block should not be same.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87817/new/

https://reviews.llvm.org/D87817



More information about the llvm-commits mailing list