diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -367,8 +367,8 @@ hasCalls |= (isa(II) && !isa(II)); if (CodeInfo) - if (auto CS = ImmutableCallSite(&*II)) - if (CS.hasOperandBundles()) + if (auto *CB = dyn_cast(&*II)) + if (CB->hasOperandBundles()) CodeInfo->OperandBundleCallSites.push_back(NewInst); if (const AllocaInst *AI = dyn_cast(II)) { @@ -424,8 +424,8 @@ VMap[OldTI] = NewInst; // Add instruction map to value. if (CodeInfo) - if (auto CS = ImmutableCallSite(OldTI)) - if (CS.hasOperandBundles()) + if (auto *CB = dyn_cast(OldTI)) + if (CB->hasOperandBundles()) CodeInfo->OperandBundleCallSites.push_back(NewInst); // Recursively clone any reachable successor blocks. @@ -619,8 +619,9 @@ // 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()) + CallBase *CB = dyn_cast(I); + if (CB && CB->getCalledFunction() && + !CB->getCalledFunction()->isIntrinsic()) continue; // See if this instruction simplifies.