[DivergenceAnalysis] Simplify inRegion test based on whether the RegionLoop pointer is null or not

More closely matches the documentation

Requested by @nikic
This commit is contained in:
Simon Pilgrim 2022-01-08 14:30:10 +00:00
parent 06e9733fec
commit be7dbd674c
1 changed files with 1 additions and 2 deletions

View File

@ -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) {