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

Gor Nishanov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 19:13:54 PDT 2016


GorNishanov marked 3 inline comments as done.

================
Comment at: lib/Transforms/Coroutines/CoroInstr.h:96-98
@@ +95,5 @@
+    Info Result;
+    auto *GV = dyn_cast<GlobalVariable>(getRawInfo());
+    if (!GV)
+      return Result;
+
----------------
Yes. There are three legal alternative that are described in the comment above and checked by the verifier.

i8* null
ConstantStruct
ConstantArray

When coro.begin comes fresh out of the frontend, info parameter is null.

================
Comment at: lib/Transforms/Coroutines/CoroInstr.h:102-103
@@ +101,4 @@
+    Constant *Initializer = GV->getInitializer();
+    if ((Result.OutlinedParts = dyn_cast<ConstantStruct>(Initializer)))
+      return Result;
+
----------------
Sure. In one of the patches working on CoroSplit, there will be a test with ConstantStruct. 


https://reviews.llvm.org/D23229





More information about the llvm-commits mailing list