summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/CodeMetrics.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2019-02-11 09:03:32 +0000
committerChandler Carruth <chandlerc@gmail.com>2019-02-11 09:03:32 +0000
commit2d2a4359a22e9c55a0247268e52db44f3d7d17fe (patch)
tree9b3d335ba7b3476cf33d657eaad93c29b64aaab0 /llvm/lib/Analysis/CodeMetrics.cpp
parent73634358a19df8c181b010b1fc89e99e00b38d9c (diff)
downloadbcm5719-llvm-2d2a4359a22e9c55a0247268e52db44f3d7d17fe.tar.gz
bcm5719-llvm-2d2a4359a22e9c55a0247268e52db44f3d7d17fe.zip
Remove `CallSite` from the CodeMetrics analysis, moving it to the new
`CallBase` and simpler APIs therein. llvm-svn: 353673
Diffstat (limited to 'llvm/lib/Analysis/CodeMetrics.cpp')
-rw-r--r--llvm/lib/Analysis/CodeMetrics.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp
index 5133192c152..627d955c865 100644
--- a/llvm/lib/Analysis/CodeMetrics.cpp
+++ b/llvm/lib/Analysis/CodeMetrics.cpp
@@ -15,7 +15,6 @@
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/Debug.h"
@@ -125,14 +124,12 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
continue;
// Special handling for calls.
- if (isa<CallInst>(I) || isa<InvokeInst>(I)) {
- ImmutableCallSite CS(&I);
-
- if (const Function *F = CS.getCalledFunction()) {
+ if (const auto *Call = dyn_cast<CallBase>(&I)) {
+ if (const Function *F = Call->getCalledFunction()) {
// If a function is both internal and has a single use, then it is
// extremely likely to get inlined in the future (it was probably
// exposed by an interleaved devirtualization pass).
- if (!CS.isNoInline() && F->hasInternalLinkage() && F->hasOneUse())
+ if (!Call->isNoInline() && F->hasInternalLinkage() && F->hasOneUse())
++NumInlineCandidates;
// If this call is to function itself, then the function is recursive.
@@ -147,7 +144,7 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
} else {
// We don't want inline asm to count as a call - that would prevent loop
// unrolling. The argument setup cost is still real, though.
- if (!isa<InlineAsm>(CS.getCalledValue()))
+ if (!Call->isInlineAsm())
++NumCalls;
}
}
OpenPOWER on IntegriCloud