Skip to content

Commit

Permalink
[CallSite removal][TargetTransformInfoImpl] Replace CallSite with Cal…
Browse files Browse the repository at this point in the history
…lBase. NFC
  • Loading branch information
topperc committed Apr 22, 2020
1 parent c08af2c commit daadb48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
Expand Up @@ -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"
Expand Down Expand Up @@ -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()) {
Expand All @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
Expand Up @@ -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 ||
Expand Down

0 comments on commit daadb48

Please sign in to comment.