1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[LoopNest] Allow empty basic blocks without loops

Addressed Florian's post commit review comments:
1. included STLExtras.h
2. changed std::all_of to llvm::all_of

Differential Revision: https://reviews.llvm.org/D93665
This commit is contained in:
Whitney Tsang 2021-01-05 18:40:24 +00:00
parent 2002c5792d
commit 982213832f

View File

@ -14,6 +14,7 @@
#ifndef LLVM_ANALYSIS_LOOPNESTANALYSIS_H
#define LLVM_ANALYSIS_LOOPNESTANALYSIS_H
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/LoopAnalysisManager.h"
#include "llvm/Analysis/LoopInfo.h"
@ -130,14 +131,12 @@ public:
/// Return true if all loops in the loop nest are in simplify form.
bool areAllLoopsSimplifyForm() const {
return llvm::all_of(Loops,
[](const Loop *L) { return L->isLoopSimplifyForm(); });
return all_of(Loops, [](const Loop *L) { return L->isLoopSimplifyForm(); });
}
/// Return true if all loops in the loop nest are in rotated form.
bool areAllLoopsRotatedForm() const {
return std::all_of(Loops.begin(), Loops.end(),
[](const Loop *L) { return L->isRotatedForm(); });
return all_of(Loops, [](const Loop *L) { return L->isRotatedForm(); });
}
StringRef getName() const { return Loops.front()->getName(); }