Skip to content

Commit 451a313

Browse files
[DominanceFrontier] Remove unused functions (#106913)
1 parent 1fbb6b4 commit 451a313

File tree

3 files changed

+0
-122
lines changed

3 files changed

+0
-122
lines changed

llvm/include/llvm/Analysis/DominanceFrontier.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,6 @@ class DominanceFrontierBase {
8585
iterator find(BlockT *B) { return Frontiers.find(B); }
8686
const_iterator find(BlockT *B) const { return Frontiers.find(B); }
8787

88-
iterator addBasicBlock(BlockT *BB, const DomSetType &frontier) {
89-
assert(find(BB) == end() && "Block already in DominanceFrontier!");
90-
return Frontiers.insert(std::make_pair(BB, frontier)).first;
91-
}
92-
93-
/// removeBlock - Remove basic block BB's frontier.
94-
void removeBlock(BlockT *BB);
95-
96-
void addToFrontier(iterator I, BlockT *Node);
97-
98-
void removeFromFrontier(iterator I, BlockT *Node);
99-
100-
/// compareDomSet - Return false if two domsets match. Otherwise
101-
/// return true;
102-
bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const;
103-
104-
/// compare - Return false if the other dominance frontier base matches
105-
/// this dominance frontier base. Otherwise return true.
106-
bool compare(DominanceFrontierBase &Other) const;
107-
10888
/// print - Convert to human readable form
10989
///
11090
void print(raw_ostream &OS) const;

llvm/include/llvm/Analysis/DominanceFrontierImpl.h

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -45,84 +45,6 @@ class DFCalculateWorkObject {
4545
const DomTreeNodeT *parentNode;
4646
};
4747

48-
template <class BlockT, bool IsPostDom>
49-
void DominanceFrontierBase<BlockT, IsPostDom>::removeBlock(BlockT *BB) {
50-
assert(find(BB) != end() && "Block is not in DominanceFrontier!");
51-
for (iterator I = begin(), E = end(); I != E; ++I)
52-
I->second.remove(BB);
53-
Frontiers.erase(BB);
54-
}
55-
56-
template <class BlockT, bool IsPostDom>
57-
void DominanceFrontierBase<BlockT, IsPostDom>::addToFrontier(iterator I,
58-
BlockT *Node) {
59-
assert(I != end() && "BB is not in DominanceFrontier!");
60-
I->second.insert(Node);
61-
}
62-
63-
template <class BlockT, bool IsPostDom>
64-
void DominanceFrontierBase<BlockT, IsPostDom>::removeFromFrontier(
65-
iterator I, BlockT *Node) {
66-
assert(I != end() && "BB is not in DominanceFrontier!");
67-
assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB");
68-
I->second.remove(Node);
69-
}
70-
71-
template <class BlockT, bool IsPostDom>
72-
bool DominanceFrontierBase<BlockT, IsPostDom>::compareDomSet(
73-
DomSetType &DS1, const DomSetType &DS2) const {
74-
std::set<BlockT *> tmpSet;
75-
for (BlockT *BB : DS2)
76-
tmpSet.insert(BB);
77-
78-
for (typename DomSetType::const_iterator I = DS1.begin(), E = DS1.end();
79-
I != E;) {
80-
BlockT *Node = *I++;
81-
82-
if (tmpSet.erase(Node) == 0)
83-
// Node is in DS1 but tnot in DS2.
84-
return true;
85-
}
86-
87-
if (!tmpSet.empty()) {
88-
// There are nodes that are in DS2 but not in DS1.
89-
return true;
90-
}
91-
92-
// DS1 and DS2 matches.
93-
return false;
94-
}
95-
96-
template <class BlockT, bool IsPostDom>
97-
bool DominanceFrontierBase<BlockT, IsPostDom>::compare(
98-
DominanceFrontierBase<BlockT, IsPostDom> &Other) const {
99-
DomSetMapType tmpFrontiers;
100-
for (typename DomSetMapType::const_iterator I = Other.begin(),
101-
E = Other.end();
102-
I != E; ++I)
103-
tmpFrontiers.insert(std::make_pair(I->first, I->second));
104-
105-
for (typename DomSetMapType::iterator I = tmpFrontiers.begin(),
106-
E = tmpFrontiers.end();
107-
I != E;) {
108-
BlockT *Node = I->first;
109-
const_iterator DFI = find(Node);
110-
if (DFI == end())
111-
return true;
112-
113-
if (compareDomSet(I->second, DFI->second))
114-
return true;
115-
116-
++I;
117-
tmpFrontiers.erase(Node);
118-
}
119-
120-
if (!tmpFrontiers.empty())
121-
return true;
122-
123-
return false;
124-
}
125-
12648
template <class BlockT, bool IsPostDom>
12749
void DominanceFrontierBase<BlockT, IsPostDom>::print(raw_ostream &OS) const {
12850
for (const_iterator I = begin(), E = end(); I != E; ++I) {

llvm/include/llvm/CodeGen/MachineDominanceFrontier.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,6 @@ class MachineDominanceFrontier : public MachineFunctionPass {
7373
return Base.find(B);
7474
}
7575

76-
iterator addBasicBlock(MachineBasicBlock *BB, const DomSetType &frontier) {
77-
return Base.addBasicBlock(BB, frontier);
78-
}
79-
80-
void removeBlock(MachineBasicBlock *BB) {
81-
return Base.removeBlock(BB);
82-
}
83-
84-
void addToFrontier(iterator I, MachineBasicBlock *Node) {
85-
return Base.addToFrontier(I, Node);
86-
}
87-
88-
void removeFromFrontier(iterator I, MachineBasicBlock *Node) {
89-
return Base.removeFromFrontier(I, Node);
90-
}
91-
92-
bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const {
93-
return Base.compareDomSet(DS1, DS2);
94-
}
95-
96-
bool compare(DominanceFrontierBase<MachineBasicBlock, false> &Other) const {
97-
return Base.compare(Other);
98-
}
99-
10076
bool runOnMachineFunction(MachineFunction &F) override;
10177

10278
void releaseMemory() override;

0 commit comments

Comments
 (0)