[llvm] r234779 - [RewriteStatepointsForGC] Avoid inserting empty holder

Philip Reames listmail at philipreames.com
Mon Apr 13 12:07:48 PDT 2015


Author: reames
Date: Mon Apr 13 14:07:47 2015
New Revision: 234779

URL: http://llvm.org/viewvc/llvm-project?rev=234779&view=rev
Log:
[RewriteStatepointsForGC] Avoid inserting empty holder

We use dummy calls to adjust the liveness of values over statepoints in the midst of the insertion.  If there are no values which need held live, there's no point in actually inserting the holder.  


Modified:
    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=234779&r1=234778&r2=234779&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Mon Apr 13 14:07:47 2015
@@ -1571,6 +1571,10 @@ static Function *getUseHolder(Module &M)
 /// liftetime of the call.
 static void insertUseHolderAfter(CallSite &CS, const ArrayRef<Value *> Values,
                                  SmallVectorImpl<CallInst *> &holders) {
+  if (Values.empty())
+    // No values to hold live, might as well not insert the empty holder
+    return;
+
   Module *M = CS.getInstruction()->getParent()->getParent()->getParent();
   Function *Func = getUseHolder(*M);
   if (CS.isCall()) {





More information about the llvm-commits mailing list