[DominanceFrontier] Remove unused functions#106913
Merged
kazutakahirata merged 1 commit intollvm:mainfrom Sep 3, 2024
Merged
Conversation
Member
|
@llvm/pr-subscribers-llvm-analysis Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/106913.diff 3 Files Affected:
diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h
index 8b3ab57ed4d07b..68ddcf753b59f7 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontier.h
@@ -85,26 +85,6 @@ class DominanceFrontierBase {
iterator find(BlockT *B) { return Frontiers.find(B); }
const_iterator find(BlockT *B) const { return Frontiers.find(B); }
- iterator addBasicBlock(BlockT *BB, const DomSetType &frontier) {
- assert(find(BB) == end() && "Block already in DominanceFrontier!");
- return Frontiers.insert(std::make_pair(BB, frontier)).first;
- }
-
- /// removeBlock - Remove basic block BB's frontier.
- void removeBlock(BlockT *BB);
-
- void addToFrontier(iterator I, BlockT *Node);
-
- void removeFromFrontier(iterator I, BlockT *Node);
-
- /// compareDomSet - Return false if two domsets match. Otherwise
- /// return true;
- bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const;
-
- /// compare - Return false if the other dominance frontier base matches
- /// this dominance frontier base. Otherwise return true.
- bool compare(DominanceFrontierBase &Other) const;
-
/// print - Convert to human readable form
///
void print(raw_ostream &OS) const;
diff --git a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
index a9c415f4701094..e877b2c4749abe 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
@@ -45,84 +45,6 @@ class DFCalculateWorkObject {
const DomTreeNodeT *parentNode;
};
-template <class BlockT, bool IsPostDom>
-void DominanceFrontierBase<BlockT, IsPostDom>::removeBlock(BlockT *BB) {
- assert(find(BB) != end() && "Block is not in DominanceFrontier!");
- for (iterator I = begin(), E = end(); I != E; ++I)
- I->second.remove(BB);
- Frontiers.erase(BB);
-}
-
-template <class BlockT, bool IsPostDom>
-void DominanceFrontierBase<BlockT, IsPostDom>::addToFrontier(iterator I,
- BlockT *Node) {
- assert(I != end() && "BB is not in DominanceFrontier!");
- I->second.insert(Node);
-}
-
-template <class BlockT, bool IsPostDom>
-void DominanceFrontierBase<BlockT, IsPostDom>::removeFromFrontier(
- iterator I, BlockT *Node) {
- assert(I != end() && "BB is not in DominanceFrontier!");
- assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB");
- I->second.remove(Node);
-}
-
-template <class BlockT, bool IsPostDom>
-bool DominanceFrontierBase<BlockT, IsPostDom>::compareDomSet(
- DomSetType &DS1, const DomSetType &DS2) const {
- std::set<BlockT *> tmpSet;
- for (BlockT *BB : DS2)
- tmpSet.insert(BB);
-
- for (typename DomSetType::const_iterator I = DS1.begin(), E = DS1.end();
- I != E;) {
- BlockT *Node = *I++;
-
- if (tmpSet.erase(Node) == 0)
- // Node is in DS1 but tnot in DS2.
- return true;
- }
-
- if (!tmpSet.empty()) {
- // There are nodes that are in DS2 but not in DS1.
- return true;
- }
-
- // DS1 and DS2 matches.
- return false;
-}
-
-template <class BlockT, bool IsPostDom>
-bool DominanceFrontierBase<BlockT, IsPostDom>::compare(
- DominanceFrontierBase<BlockT, IsPostDom> &Other) const {
- DomSetMapType tmpFrontiers;
- for (typename DomSetMapType::const_iterator I = Other.begin(),
- E = Other.end();
- I != E; ++I)
- tmpFrontiers.insert(std::make_pair(I->first, I->second));
-
- for (typename DomSetMapType::iterator I = tmpFrontiers.begin(),
- E = tmpFrontiers.end();
- I != E;) {
- BlockT *Node = I->first;
- const_iterator DFI = find(Node);
- if (DFI == end())
- return true;
-
- if (compareDomSet(I->second, DFI->second))
- return true;
-
- ++I;
- tmpFrontiers.erase(Node);
- }
-
- if (!tmpFrontiers.empty())
- return true;
-
- return false;
-}
-
template <class BlockT, bool IsPostDom>
void DominanceFrontierBase<BlockT, IsPostDom>::print(raw_ostream &OS) const {
for (const_iterator I = begin(), E = end(); I != E; ++I) {
diff --git a/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h b/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
index e3e679608784a4..7df060a3f5b1a9 100644
--- a/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
+++ b/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
@@ -73,30 +73,6 @@ class MachineDominanceFrontier : public MachineFunctionPass {
return Base.find(B);
}
- iterator addBasicBlock(MachineBasicBlock *BB, const DomSetType &frontier) {
- return Base.addBasicBlock(BB, frontier);
- }
-
- void removeBlock(MachineBasicBlock *BB) {
- return Base.removeBlock(BB);
- }
-
- void addToFrontier(iterator I, MachineBasicBlock *Node) {
- return Base.addToFrontier(I, Node);
- }
-
- void removeFromFrontier(iterator I, MachineBasicBlock *Node) {
- return Base.removeFromFrontier(I, Node);
- }
-
- bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const {
- return Base.compareDomSet(DS1, DS2);
- }
-
- bool compare(DominanceFrontierBase<MachineBasicBlock, false> &Other) const {
- return Base.compare(Other);
- }
-
bool runOnMachineFunction(MachineFunction &F) override;
void releaseMemory() override;
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.