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()) {