[PATCH] D23234: [Coroutines] Part 5: Add CGSCC restart trigger

Gor Nishanov via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 6 07:33:25 PDT 2016


GorNishanov marked 6 inline comments as done.

================
Comment at: lib/Transforms/Coroutines/CoroSplit.cpp:32-35
@@ +31,6 @@
+  // Find a spot in the entry block to insert a call to devirt trigger function.
+  BasicBlock &EntryBlock = F.getEntryBlock();
+  BasicBlock::iterator It = EntryBlock.begin();
+  while (isa<AllocaInst>(*It) || isa<DbgInfoIntrinsic>(*It))
+    ++It;
+
----------------
majnemer wrote:
> Any reason why you don't just use `EntryBlock.getFirstInsertionPt()`?
getFirstInsertionPt does not skip over AllocaInst. Some passes, Reg2Mem, Inliner, for example, assume that entry block starts with (possibly empty) sequence of AllocaInst.

I don't have to skip over DbgInfoIntrinsic though. I can make this loop to be simply:

while (isa<AllocaInst>(*It)) ++It;



https://reviews.llvm.org/D23234





More information about the llvm-commits mailing list