-
Notifications
You must be signed in to change notification settings - Fork 15.9k
[NFC][DominanceFrontier] Remove unused return value #178708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can't add reviewers, tagging @fhahn . |
|
@llvm/pr-subscribers-llvm-analysis Author: Andrei Elovikov (eas) ChangesFull diff: https://github.com/llvm/llvm-project/pull/178708.diff 2 Files Affected:
diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h
index 787793501f98a..ec49b36d64cfd 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontier.h
@@ -116,7 +116,7 @@ class ForwardDominanceFrontierBase
calculate(DT, DT[this->Roots[0]]);
}
- const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node);
+ void calculate(const DomTreeT &DT, const DomTreeNodeT *Node);
};
class DominanceFrontier : public ForwardDominanceFrontierBase<BasicBlock> {
diff --git a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
index 1483588581f4e..c7fc463fd3af5 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
@@ -74,11 +74,9 @@ void DominanceFrontierBase<BlockT, IsPostDom>::dump() const {
#endif
template <class BlockT>
-const typename ForwardDominanceFrontierBase<BlockT>::DomSetType &
-ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
- const DomTreeNodeT *Node) {
+void ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
+ const DomTreeNodeT *Node) {
BlockT *BB = Node->getBlock();
- DomSetType *Result = nullptr;
std::vector<DFCalculateWorkObject<BlockT>> workList;
SmallPtrSet<BlockT *, 32> visited;
@@ -126,7 +124,6 @@ ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
// from the workList.
if (!visitChild) {
if (!parentBB) {
- Result = &S;
break;
}
@@ -140,8 +137,6 @@ ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
}
} while (!workList.empty());
-
- return *Result;
}
} // end namespace llvm
|
| calculate(DT, DT[this->Roots[0]]); | ||
| } | ||
|
|
||
| const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of the using for DomSetType here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still used inside the definition of calculate, so we need this using somewhere. Either here or in the calculate itself. The reason why we need it is because C++ template classes don't automatically "inherit" type aliases from their base class templates (see https://godbolt.org/z/vvPPrcr4K), something with type needed to be template-dependent, I believe.
Given "why" we need this using (to fight C++), there can be argument made that we should do it here at the class definition and not inside calculate. I don't object to doing this move, but can you please confirm you really want it done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if desired, may be better to do this move as separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, didn't see the extra use. Seems reasonable enough to me then.
fhahn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
| calculate(DT, DT[this->Roots[0]]); | ||
| } | ||
|
|
||
| const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if desired, may be better to do this move as separate PR
|
@fhahn , @boomanaiden154 , I will need help to get this merged, thank you! |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/39851 Here is the relevant piece of the build log for the reference |
No description provided.