================
@@ -1056,6 +1083,25 @@ void CoroCloner::create() {
   // Set up the new entry block.
   replaceEntryBlock();
 
+  // Turn symmetric transfers into musttail calls.
+  for (CallInst *ResumeCall : Shape.SymmetricTransfers) {
+    ResumeCall = cast<CallInst>(VMap[ResumeCall]);
+    ResumeCall->setCallingConv(NewF->getCallingConv());
+    if (TTI.supportsTailCallFor(ResumeCall)) {
+      // FIXME: Could we support symmetric transfer effectively without
+      // musttail?
+      ResumeCall->setTailCallKind(CallInst::TCK_MustTail);
+    }
+
+    // Put a 'ret void' after the call, and split any remaining instructions to
----------------
mtrofin wrote:

In your example, if they derive some result based on the initial set of 
instrumentations they insert, they may produce reports that say "incomplete 
coverage" (for example). Some level of knowledge ends up being passed down to 
someone - maybe the user, maybe the analyzer of the data.

But I get the idea that maybe the domain is OK with loss of instructions, so 
the assert could be annoying. Dunno, only saw the example where it wasn't.

How about an ORE? The output could technically be usable by a tool in a 
fictitious coverage case, it offers more focused observability than dumping IR 
before/after in a debugging case, and it serves as self-documentation in the 
pass itself that "ya, we're dropping stuff here. It's intentional". The ORE 
wouldn't need to be too complex, maybe if we detect non-debug (and maybe also 
exclude lifetime) instructions, ORE out. WDYT?

https://github.com/llvm/llvm-project/pull/89751
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to