[CallSite removal][TargetTransformInfoImpl] Replace CallSite with CallBase. NFC

This commit is contained in:
Craig Topper 2020-04-21 00:55:35 -07:00
parent c08af2c11a
commit daadb48553
2 changed files with 4 additions and 6 deletions

View File

@ -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 @@ public:
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 @@ public:
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();

View File

@ -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 ||