[llvm] 3e27fb8 - [PSE] Allow duplicate predicates in debug output

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 10:39:08 PST 2022


Author: Philip Reames
Date: 2022-02-11T10:39:01-08:00
New Revision: 3e27fb8590591ff963761136d0e6879e8e081471

URL: https://github.com/llvm/llvm-project/commit/3e27fb8590591ff963761136d0e6879e8e081471
DIFF: https://github.com/llvm/llvm-project/commit/3e27fb8590591ff963761136d0e6879e8e081471.diff

LOG: [PSE] Allow duplicate predicates in debug output

This lets us avoid redundant implication work in the constructor of SCEVUnionPredicate which simplifies an upcoming change.  If we're actually building a predicate via PSE, that goes through addPredicate which does include the implication check.

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 465e52bf03757..1f6767c894f3b 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -12866,8 +12866,8 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
   if (!isa<SCEVCouldNotCompute>(PBT)) {
     OS << "Predicated backedge-taken count is " << *PBT << "\n";
     OS << " Predicates:\n";
-    SCEVUnionPredicate Dedup(Preds);
-    Dedup.print(OS, 4);
+    for (auto *P : Preds)
+      P->print(OS, 4);
   } else {
     OS << "Unpredictable predicated backedge-taken count. ";
   }
@@ -13907,9 +13907,6 @@ void SCEVUnionPredicate::add(const SCEVPredicate *N) {
     return;
   }
 
-  if (implies(N))
-    return;
-
   const SCEV *Key = N->getExpr();
   assert(Key && "Only SCEVUnionPredicate doesn't have an "
                 " associated expression!");


        


More information about the llvm-commits mailing list