[llvm] be7dbd6 - [DivergenceAnalysis] Simplify inRegion test based on whether the RegionLoop pointer is null or not
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 8 06:30:22 PST 2022
Author: Simon Pilgrim
Date: 2022-01-08T14:30:10Z
New Revision: be7dbd674cb0cec2558e054c39be0eb098a99394
URL: https://github.com/llvm/llvm-project/commit/be7dbd674cb0cec2558e054c39be0eb098a99394
DIFF: https://github.com/llvm/llvm-project/commit/be7dbd674cb0cec2558e054c39be0eb098a99394.diff
LOG: [DivergenceAnalysis] Simplify inRegion test based on whether the RegionLoop pointer is null or not
More closely matches the documentation
Requested by @nikic
Added:
Modified:
llvm/lib/Analysis/DivergenceAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/DivergenceAnalysis.cpp b/llvm/lib/Analysis/DivergenceAnalysis.cpp
index 3a92819b1fc6..62ac6f693fe3 100644
--- a/llvm/lib/Analysis/DivergenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DivergenceAnalysis.cpp
@@ -130,8 +130,7 @@ bool DivergenceAnalysisImpl::inRegion(const Instruction &I) const {
}
bool DivergenceAnalysisImpl::inRegion(const BasicBlock &BB) const {
- return (!RegionLoop && BB.getParent() == &F) ||
- (RegionLoop && RegionLoop->contains(&BB));
+ return RegionLoop ? RegionLoop->contains(&BB) : (BB.getParent() == &F);
}
void DivergenceAnalysisImpl::pushUsers(const Value &V) {
More information about the llvm-commits
mailing list