From: Simon Pilgrim Date: Sat, 8 Jan 2022 14:30:10 +0000 (+0000) Subject: [DivergenceAnalysis] Simplify inRegion test based on whether the RegionLoop pointer... X-Git-Tag: upstream/15.0.7~21206 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be7dbd674cb0cec2558e054c39be0eb098a99394;p=platform%2Fupstream%2Fllvm.git [DivergenceAnalysis] Simplify inRegion test based on whether the RegionLoop pointer is null or not More closely matches the documentation Requested by @nikic --- diff --git a/llvm/lib/Analysis/DivergenceAnalysis.cpp b/llvm/lib/Analysis/DivergenceAnalysis.cpp index 3a92819..62ac6f69 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) {