From 887f197370e1d3969f8fe559d55b146f73f06a3e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 24 Aug 2016 17:35:37 +0000 Subject: Vendor import of llvm release_39 branch r279477: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279477 --- lib/Transforms/Utils/CloneFunction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Transforms/Utils/CloneFunction.cpp') diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index 4f1052d81433f..4d33e22fecfbd 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -566,6 +566,12 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc, if (!I) continue; + // Skip over non-intrinsic callsites, we don't want to remove any nodes from + // the CGSCC. + CallSite CS = CallSite(I); + if (CS && CS.getCalledFunction() && !CS.getCalledFunction()->isIntrinsic()) + continue; + // See if this instruction simplifies. Value *SimpleV = SimplifyInstruction(I, DL); if (!SimpleV) -- cgit v1.2.3