diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp | 8 |
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; |