[PATCH] D43729: [CallSiteSplitting] properly split musttail calls

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 01:54:46 PST 2018


fhahn added a comment.

Thanks for the patch. I think it would be simpler (and less code) to integrate musttail handling directly in splitCallSite, rather than patching up afterwards. See my inline comments and please let me know what you think/if I am missing something.



================
Comment at: lib/Transforms/Scalar/CallSiteSplitting.cpp:376
                  << "\n");
     if (CallPN)
       CallPN->addIncoming(NewCI, SplitBlock);
----------------
For musttail calls, I think we could clone the bitcast & ret instructions here and move them after NewCi. Instead of adding the result to the Call phi node, we just have to  updated the cloned bitcast/ret instruction to use NewCI instead of the original one.


================
Comment at: lib/Transforms/Scalar/CallSiteSplitting.cpp:379
   }
 
   auto *OriginalBegin = &*TailBB->begin();
----------------
For musttail calls, we should be able to just delete the BB once we handled all predecessors and we are done.


https://reviews.llvm.org/D43729





More information about the llvm-commits mailing list