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

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 20:12:07 PDT 2020


junparser added a comment.

In D87817#2288579 <https://reviews.llvm.org/D87817#2288579>, @asbirlea wrote:

> Can you please extend the testing to cover at least some of these cases: multiple predecesssors, multiple exit blocks, multiple predecessors with a coroutine switch?

ok, I'll add later.



================
Comment at: llvm/test/Transforms/LICM/sink-with-coroutine.ll:18
+; CHECK-NEXT:    switch i8 [[SUSPEND]], label [[BB2_SPLIT_LOOP_EXIT1:%.*]] [
+; CHECK-NEXT:    i8 0, label [[AWAIT_READY]]
+; CHECK-NEXT:    ]
----------------
asbirlea wrote:
> Following up on the question of "is it always a switch", this looks like it could be have optimized to:
> ```
>  %cond = icmp eq i8  [[SUSPEND]], 0
> br i8 [[AWAIT_READY]], label [[BB2_SPLIT_LOOP_EXIT1:%.*]]
> ```
> For example, simple loop unswitch may do such a change, and licm is in the same LPM, so perhaps this is possible.
I missed the cleanup label.  the switch is 

```
  switch i8 %suspend, label %bb2 [
  i8 0, label %await.ready
  i8 1, label %cleanup
  ]
```


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

https://reviews.llvm.org/D87817



More information about the llvm-commits mailing list