Skip to content

Commit eec7ef7

Browse files
committed
Reverted r375254 as it has broken some build bots for a long time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375375 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e568120 commit eec7ef7

File tree

15 files changed

+20
-661
lines changed

15 files changed

+20
-661
lines changed

include/llvm/CodeGen/MachineBlockFrequencyInfo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ class MachineBlockFrequencyInfo : public MachineFunctionPass {
3838
static char ID;
3939

4040
MachineBlockFrequencyInfo();
41-
explicit MachineBlockFrequencyInfo(MachineFunction &F,
42-
MachineBranchProbabilityInfo &MBPI,
43-
MachineLoopInfo &MLI);
4441
~MachineBlockFrequencyInfo() override;
4542

4643
void getAnalysisUsage(AnalysisUsage &AU) const override;

include/llvm/CodeGen/MachineDominators.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ class MachineDominatorTree : public MachineFunctionPass {
8181
static char ID; // Pass ID, replacement for typeid
8282

8383
MachineDominatorTree();
84-
explicit MachineDominatorTree(MachineFunction &MF) : MachineFunctionPass(ID) {
85-
calculate(MF);
86-
}
8784

8885
DomTreeT &getBase() {
8986
if (!DT) DT.reset(new DomTreeT());
@@ -114,8 +111,6 @@ class MachineDominatorTree : public MachineFunctionPass {
114111

115112
bool runOnMachineFunction(MachineFunction &F) override;
116113

117-
void calculate(MachineFunction &F);
118-
119114
bool dominates(const MachineDomTreeNode *A,
120115
const MachineDomTreeNode *B) const {
121116
applySplitCriticalEdges();

include/llvm/CodeGen/MachineLoopInfo.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
namespace llvm {
3939

40-
class MachineDominatorTree;
4140
// Implementation in LoopInfoImpl.h
4241
class MachineLoop;
4342
extern template class LoopBase<MachineBasicBlock, MachineLoop>;
@@ -92,10 +91,6 @@ class MachineLoopInfo : public MachineFunctionPass {
9291
MachineLoopInfo() : MachineFunctionPass(ID) {
9392
initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry());
9493
}
95-
explicit MachineLoopInfo(MachineDominatorTree &MDT)
96-
: MachineFunctionPass(ID) {
97-
calculate(MDT);
98-
}
9994
MachineLoopInfo(const MachineLoopInfo &) = delete;
10095
MachineLoopInfo &operator=(const MachineLoopInfo &) = delete;
10196

@@ -138,7 +133,6 @@ class MachineLoopInfo : public MachineFunctionPass {
138133

139134
/// Calculate the natural loop information.
140135
bool runOnMachineFunction(MachineFunction &F) override;
141-
void calculate(MachineDominatorTree &MDT);
142136

143137
void releaseMemory() override { LI.releaseMemory(); }
144138

include/llvm/CodeGen/MachineSizeOpts.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

include/llvm/Transforms/Utils/SizeOpts.h

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -13,71 +13,20 @@
1313
#ifndef LLVM_TRANSFORMS_UTILS_SIZEOPTS_H
1414
#define LLVM_TRANSFORMS_UTILS_SIZEOPTS_H
1515

16-
#include "llvm/Analysis/BlockFrequencyInfo.h"
17-
#include "llvm/Analysis/ProfileSummaryInfo.h"
18-
#include "llvm/Support/CommandLine.h"
19-
20-
using namespace llvm;
21-
22-
extern cl::opt<bool> EnablePGSO;
23-
extern cl::opt<bool> PGSOLargeWorkingSetSizeOnly;
24-
extern cl::opt<bool> ForcePGSO;
25-
extern cl::opt<int> PgsoCutoffInstrProf;
26-
extern cl::opt<int> PgsoCutoffSampleProf;
27-
2816
namespace llvm {
2917

3018
class BasicBlock;
3119
class BlockFrequencyInfo;
3220
class Function;
3321
class ProfileSummaryInfo;
3422

35-
template<typename AdapterT, typename FuncT, typename BFIT>
36-
bool shouldFuncOptimizeForSizeImpl(const FuncT *F, ProfileSummaryInfo *PSI,
37-
BFIT *BFI) {
38-
assert(F);
39-
if (!PSI || !BFI || !PSI->hasProfileSummary())
40-
return false;
41-
if (ForcePGSO)
42-
return true;
43-
if (!EnablePGSO)
44-
return false;
45-
if (PGSOLargeWorkingSetSizeOnly && !PSI->hasLargeWorkingSetSize()) {
46-
// Even if the working set size isn't large, size-optimize cold code.
47-
return AdapterT::isFunctionColdInCallGraph(F, PSI, *BFI);
48-
}
49-
return !AdapterT::isFunctionHotInCallGraphNthPercentile(
50-
PSI->hasSampleProfile() ? PgsoCutoffSampleProf : PgsoCutoffInstrProf,
51-
F, PSI, *BFI);
52-
}
53-
54-
template<typename AdapterT, typename BlockT, typename BFIT>
55-
bool shouldOptimizeForSizeImpl(const BlockT *BB, ProfileSummaryInfo *PSI,
56-
BFIT *BFI) {
57-
assert(BB);
58-
if (!PSI || !BFI || !PSI->hasProfileSummary())
59-
return false;
60-
if (ForcePGSO)
61-
return true;
62-
if (!EnablePGSO)
63-
return false;
64-
if (PGSOLargeWorkingSetSizeOnly && !PSI->hasLargeWorkingSetSize()) {
65-
// Even if the working set size isn't large, size-optimize cold code.
66-
return AdapterT::isColdBlock(BB, PSI, BFI);
67-
}
68-
return !AdapterT::isHotBlockNthPercentile(
69-
PSI->hasSampleProfile() ? PgsoCutoffSampleProf : PgsoCutoffInstrProf,
70-
BB, PSI, BFI);
71-
}
72-
7323
/// Returns true if function \p F is suggested to be size-optimized base on the
7424
/// profile.
75-
bool shouldOptimizeForSize(const Function *F, ProfileSummaryInfo *PSI,
25+
bool shouldOptimizeForSize(Function *F, ProfileSummaryInfo *PSI,
7626
BlockFrequencyInfo *BFI);
77-
7827
/// Returns true if basic block \p BB is suggested to be size-optimized base
7928
/// on the profile.
80-
bool shouldOptimizeForSize(const BasicBlock *BB, ProfileSummaryInfo *PSI,
29+
bool shouldOptimizeForSize(BasicBlock *BB, ProfileSummaryInfo *PSI,
8130
BlockFrequencyInfo *BFI);
8231

8332
} // end namespace llvm

lib/CodeGen/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ add_llvm_library(LLVMCodeGen
9292
MachineRegisterInfo.cpp
9393
MachineScheduler.cpp
9494
MachineSink.cpp
95-
MachineSizeOpts.cpp
9695
MachineSSAUpdater.cpp
9796
MachineTraceMetrics.cpp
9897
MachineVerifier.cpp

lib/CodeGen/MachineBlockFrequencyInfo.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,6 @@ MachineBlockFrequencyInfo::MachineBlockFrequencyInfo()
172172
initializeMachineBlockFrequencyInfoPass(*PassRegistry::getPassRegistry());
173173
}
174174

175-
MachineBlockFrequencyInfo::MachineBlockFrequencyInfo(
176-
MachineFunction &F,
177-
MachineBranchProbabilityInfo &MBPI,
178-
MachineLoopInfo &MLI) : MachineFunctionPass(ID) {
179-
calculate(F, MBPI, MLI);
180-
}
181-
182175
MachineBlockFrequencyInfo::~MachineBlockFrequencyInfo() = default;
183176

184177
void MachineBlockFrequencyInfo::getAnalysisUsage(AnalysisUsage &AU) const {

lib/CodeGen/MachineDominators.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,11 @@ void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const {
4949
}
5050

5151
bool MachineDominatorTree::runOnMachineFunction(MachineFunction &F) {
52-
calculate(F);
53-
return false;
54-
}
55-
56-
void MachineDominatorTree::calculate(MachineFunction &F) {
5752
CriticalEdgesToSplit.clear();
5853
NewBBs.clear();
5954
DT.reset(new DomTreeBase<MachineBasicBlock>());
6055
DT->recalculate(F);
56+
return false;
6157
}
6258

6359
MachineDominatorTree::MachineDominatorTree()

lib/CodeGen/MachineLoopInfo.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,9 @@ INITIALIZE_PASS_END(MachineLoopInfo, "machine-loops",
3636
char &llvm::MachineLoopInfoID = MachineLoopInfo::ID;
3737

3838
bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
39-
calculate(getAnalysis<MachineDominatorTree>());
40-
return false;
41-
}
42-
43-
void MachineLoopInfo::calculate(MachineDominatorTree &MDT) {
4439
releaseMemory();
45-
LI.analyze(MDT.getBase());
40+
LI.analyze(getAnalysis<MachineDominatorTree>().getBase());
41+
return false;
4642
}
4743

4844
void MachineLoopInfo::getAnalysisUsage(AnalysisUsage &AU) const {

lib/CodeGen/MachineSizeOpts.cpp

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)