[PATCH] D81023: CoroSplit: Fix coroutine splitting for retcon and retcon once

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 13:44:27 PDT 2020


rjmccall added a comment.

I continue to find the presence of non-coroutine stuff in a coroutine function unnerving, but this seems to be a reasonable fix for it.



================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:903
+
+  // retcon and recononce lowering assumes all uses have been sunk.
+  if (Shape.ABI == coro::ABI::Retcon || Shape.ABI == coro::ABI::RetconOnce) {
----------------
retcon.once


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1511
+
+  // Collect all users that preceed coro.begin.
+  for (auto const &entry : spills) {
----------------
precede


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1540
+            [&dom](Instruction *a, Instruction *b) -> bool {
+              // If a dominates b it should preceed (<) b.
+              return dom.dominates(a, b);
----------------
precede


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1542
+              return dom.dominates(a, b);
+            });
+
----------------
This can use `array_pod_sort`, I think.


================
Comment at: llvm/test/Transforms/Coroutines/coro-retcon-frame.ll:39
+}
+; Make sure we don't loose writes to the frame.
+; CHECK-LABEL: define { i8*, { i64, i64 }* } @f(i8* %buffer) {
----------------
lose


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81023





More information about the llvm-commits mailing list