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

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 16:36:58 PDT 2020


lxfind 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
----------------
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?


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