From 7bea98826a5f50f3c331d7937434139e269e95cd Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Mon, 13 Apr 2015 19:07:47 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234779 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 47d6ffb3064..8c2cb355668 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1571,6 +1571,10 @@ static Function *getUseHolder(Module &M) { /// liftetime of the call. static void insertUseHolderAfter(CallSite &CS, const ArrayRef Values, SmallVectorImpl &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()) {