[llvm] [SCEV] Don't add predicates already implied by UnionPredicate. (PR #93397)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun May 26 18:31:00 PDT 2024


================
@@ -14746,8 +14746,12 @@ void SCEVUnionPredicate::print(raw_ostream &OS, unsigned Depth) const {
 
 void SCEVUnionPredicate::add(const SCEVPredicate *N) {
   if (const auto *Set = dyn_cast<SCEVUnionPredicate>(N)) {
-    for (const auto *Pred : Set->Preds)
+    for (const auto *Pred : Set->Preds) {
+      // Skip predicates already implied by this union predicate.
+      if (implies(Pred))
+        continue;
----------------
fhahn wrote:

Moved, thanks!

https://github.com/llvm/llvm-project/pull/93397


More information about the llvm-commits mailing list