summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp b/llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp
index 45fd432fd721e..1b1e91cafa651 100644
--- a/llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp
+++ b/llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp
@@ -31,7 +31,6 @@
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Analysis/SyntheticCountsUtils.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
@@ -110,14 +109,13 @@ PreservedAnalyses SyntheticCountsPropagation::run(Module &M,
Optional<Scaled64> Res = None;
if (!Edge.first)
return Res;
- assert(isa<Instruction>(Edge.first));
- CallSite CS(cast<Instruction>(Edge.first));
- Function *Caller = CS.getCaller();
+ CallBase &CB = *cast<CallBase>(*Edge.first);
+ Function *Caller = CB.getCaller();
auto &BFI = FAM.getResult<BlockFrequencyAnalysis>(*Caller);
// Now compute the callsite count from relative frequency and
// entry count:
- BasicBlock *CSBB = CS.getInstruction()->getParent();
+ BasicBlock *CSBB = CB.getParent();
Scaled64 EntryFreq(BFI.getEntryFreq(), 0);
Scaled64 BBCount(BFI.getBlockFreq(CSBB).getFrequency(), 0);
BBCount /= EntryFreq;