Skip to content

Commit 4e6ec0b

Browse files
committed
[SCEV] Replace redundant !Preds.empty() check with assert. (NFCI)
If there are no predicates, the predicated counts should not be different to the non-predicated ones.
1 parent 0ee10e9 commit 4e6ec0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13734,7 +13734,8 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
1373413734

1373513735
SmallVector<const SCEVPredicate *, 4> Preds;
1373613736
auto *PBT = SE->getPredicatedBackedgeTakenCount(L, Preds);
13737-
if (PBT != BTC || !Preds.empty()) {
13737+
if (PBT != BTC) {
13738+
assert(!Preds.empty() && "Different predicated BTC, but no predicates");
1373813739
OS << "Loop ";
1373913740
L->getHeader()->printAsOperand(OS, /*PrintType=*/false);
1374013741
OS << ": ";
@@ -13753,6 +13754,8 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
1375313754
auto *PredSymbolicMax =
1375413755
SE->getPredicatedSymbolicMaxBackedgeTakenCount(L, Preds);
1375513756
if (SymbolicBTC != PredSymbolicMax) {
13757+
assert(!Preds.empty() &&
13758+
"Different predicated symbolic max BTC, but no predicates");
1375613759
OS << "Loop ";
1375713760
L->getHeader()->printAsOperand(OS, /*PrintType=*/false);
1375813761
OS << ": ";

0 commit comments

Comments
 (0)