[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
Mon Feb 15 11:04:20 PST 2021


lxfind added a comment.

@junparser I have been re-thinking about this patch, and now I actually think this is the right patch to go.
Other than the correctness reasons, I realize that it is almost always harmful to do LICM for a loop that contains a coroutine suspension. The reason is that in most cases LICM moves memory operations out of the loop. (LICM does move constant calls as well but it is relatively rare to have constant calls that's not inlined, furthermore there are other complications such as TLS access and etc.).
For memory operations, moving them out of the loop does not make the loop faster if there is a coroutine suspend in the loop, because the value moved out needs to be put on the coroutine frame anyway. So LICM not only does not eliminate memory access but increases the frame size.
I propose to bring this patch back. (I can help send it too)
What do you think?


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