From fbb804983d0b6478a5baba9a6c10bb06bc179b6f Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 15 Apr 2020 15:11:14 -0700 Subject: [PATCH] [CallSite removal][CloneFunction] Use CallSite instead of CallBase. NFC Differential Revision: https://reviews.llvm.org/D78236 --- llvm/lib/Transforms/Utils/CloneFunction.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 1e020db..fce926f 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -367,8 +367,8 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, 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 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, 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 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc, // 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. -- 2.7.4