[llvm] daadb48 - [CallSite removal][TargetTransformInfoImpl] Replace CallSite with CallBase. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 21 22:49:58 PDT 2020
Author: Craig Topper
Date: 2020-04-21T22:49:30-07:00
New Revision: daadb4855399f27c8e5af18c3ae51169df4c6d5a
URL: https://github.com/llvm/llvm-project/commit/daadb4855399f27c8e5af18c3ae51169df4c6d5a
DIFF: https://github.com/llvm/llvm-project/commit/daadb4855399f27c8e5af18c3ae51169df4c6d5a.diff
LOG: [CallSite removal][TargetTransformInfoImpl] Replace CallSite with CallBase. NFC
Added:
Modified:
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index 1cf625e60d3f..773608fa84c8 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -17,7 +17,6 @@
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/VectorUtils.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
@@ -796,8 +795,8 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
unsigned getUserCost(const User *U, ArrayRef<const Value *> Operands) {
auto *TargetTTI = static_cast<T *>(this);
- if (auto CS = ImmutableCallSite(U)) {
- const Function *F = CS.getCalledFunction();
+ if (const auto *CB = dyn_cast<CallBase>(U)) {
+ const Function *F = CB->getCalledFunction();
if (F) {
FunctionType *FTy = F->getFunctionType();
if (Intrinsic::ID IID = F->getIntrinsicID()) {
@@ -811,7 +810,7 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
return TTI::TCC_Basic * (FTy->getNumParams() + 1);
}
- return TTI::TCC_Basic * (CS.arg_size() + 1);
+ return TTI::TCC_Basic * (CB->arg_size() + 1);
}
Type *Ty = U->getType();
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
index d597dcf79517..32a28c5f4e67 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
@@ -246,8 +246,7 @@ void SystemZTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
for (auto &BB : L->blocks())
for (auto &I : *BB) {
if (isa<CallInst>(&I) || isa<InvokeInst>(&I)) {
- ImmutableCallSite CS(&I);
- if (const Function *F = CS.getCalledFunction()) {
+ if (const Function *F = cast<CallBase>(I).getCalledFunction()) {
if (isLoweredToCall(F))
HasCall = true;
if (F->getIntrinsicID() == Intrinsic::memcpy ||
More information about the llvm-commits
mailing list