Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 2033057

Browse files
committed
Revert "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)
This reverts commit r206666, as planned. Still stumped on why the bots are failing. Sanitizer bots haven't turned anything up. If anyone can help me debug either of the failures (referenced in r206666) I'll owe them a beer. (In the meantime, I'll be auditing my patch for undefined behaviour.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206677 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 55c1e1b commit 2033057

12 files changed

+316
-3103
lines changed

include/llvm/Analysis/BlockFrequencyInfoImpl.h

+283-1,606
Large diffs are not rendered by default.

lib/Analysis/BlockFrequencyInfo.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#define DEBUG_TYPE "block-freq"
1514
#include "llvm/Analysis/BlockFrequencyInfo.h"
1615
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
1716
#include "llvm/Analysis/BranchProbabilityInfo.h"
@@ -107,7 +106,6 @@ struct DOTGraphTraits<BlockFrequencyInfo*> : public DefaultDOTGraphTraits {
107106
INITIALIZE_PASS_BEGIN(BlockFrequencyInfo, "block-freq",
108107
"Block Frequency Analysis", true, true)
109108
INITIALIZE_PASS_DEPENDENCY(BranchProbabilityInfo)
110-
INITIALIZE_PASS_DEPENDENCY(LoopInfo)
111109
INITIALIZE_PASS_END(BlockFrequencyInfo, "block-freq",
112110
"Block Frequency Analysis", true, true)
113111

@@ -122,16 +120,14 @@ BlockFrequencyInfo::~BlockFrequencyInfo() {}
122120

123121
void BlockFrequencyInfo::getAnalysisUsage(AnalysisUsage &AU) const {
124122
AU.addRequired<BranchProbabilityInfo>();
125-
AU.addRequired<LoopInfo>();
126123
AU.setPreservesAll();
127124
}
128125

129126
bool BlockFrequencyInfo::runOnFunction(Function &F) {
130127
BranchProbabilityInfo &BPI = getAnalysis<BranchProbabilityInfo>();
131-
LoopInfo &LI = getAnalysis<LoopInfo>();
132128
if (!BFI)
133129
BFI.reset(new ImplType);
134-
BFI->doFunction(&F, &BPI, &LI);
130+
BFI->doFunction(&F, &BPI);
135131
#ifndef NDEBUG
136132
if (ViewBlockFreqPropagationDAG != GVDT_None)
137133
view();
@@ -162,7 +158,7 @@ void BlockFrequencyInfo::view() const {
162158
}
163159

164160
const Function *BlockFrequencyInfo::getFunction() const {
165-
return BFI ? BFI->getFunction() : nullptr;
161+
return BFI ? BFI->Fn : nullptr;
166162
}
167163

168164
raw_ostream &BlockFrequencyInfo::

0 commit comments

Comments
 (0)