[PATCH] D86190: [LICM][Coroutine] Don't sink stores from loops with coro.suspend instructions.

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 20:57:49 PDT 2020


junparser added inline comments.


================
Comment at: llvm/test/Transforms/LICM/sink-with-coroutine.ll:37
+  %suspend = call i8 @llvm.coro.suspend(token none, i1 false)
+  switch i8 %suspend, label %bb2 [
+  i8 0, label %await.ready
----------------
lxfind wrote:
> It seems to me the problem is that the LICM generated code is mixing the loop exit basic block vs the return basic block. It just happens that both the suspend switch and loop exit condition jumps to the same block %bb2, but they mean different things.
> I think we should still be able to do LICM when there is coroutine, but it's just that we need to make sure the instructions are moved to the loop exit block, while the suspend switch should remain jumping to the return block?
Thanks for the suggestion. This might be the right fix, I'll check it later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86190



More information about the llvm-commits mailing list