[PATCH] D23229: Part 4c: Coroutine Devirtualization: Devirtualize coro.resume and coro.destroy.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 18:20:24 PDT 2016


majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.

LGTM w/ nits addressed.


================
Comment at: lib/Transforms/Coroutines/CoroInstr.h:96-98
@@ +95,5 @@
+    Info Result;
+    auto *GV = dyn_cast<GlobalVariable>(getRawInfo());
+    if (!GV)
+      return Result;
+
----------------
Can this ever fail? I thought the verifier checks to make sure that we have a GlobalVariable operand.

================
Comment at: lib/Transforms/Coroutines/CoroInstr.h:102-103
@@ +101,4 @@
+    Constant *Initializer = GV->getInitializer();
+    if ((Result.OutlinedParts = dyn_cast<ConstantStruct>(Initializer)))
+      return Result;
+
----------------
Could we have a ConstantStruct test case as well?

================
Comment at: test/Transforms/Coroutines/coro-elide.ll:30
@@ +29,3 @@
+
+; CHECK-LABEL: @callResume
+define void @callResume() {
----------------
I'd recommend ending all these function names with an open paren like so:
  ; CHECK-LABEL: @callResume(

This way we will not confuse FileCheck when we add @callResumeComplicated()


https://reviews.llvm.org/D23229





More information about the llvm-commits mailing list