[llvm] [SCEV] Use Step and Start to check if SCEVWrapPredicate is implied. (PR #118184)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 30 15:19:16 PST 2024


================
@@ -14934,10 +14936,52 @@ SCEVWrapPredicate::SCEVWrapPredicate(const FoldingSetNodeIDRef ID,
 
 const SCEVAddRecExpr *SCEVWrapPredicate::getExpr() const { return AR; }
 
-bool SCEVWrapPredicate::implies(const SCEVPredicate *N) const {
+bool SCEVWrapPredicate::implies(const SCEVPredicate *N,
+                                ScalarEvolution &SE) const {
   const auto *Op = dyn_cast<SCEVWrapPredicate>(N);
+  if (!Op)
+    return false;
+
+  if (setFlags(Flags, Op->Flags) != Flags)
----------------
preames wrote:

You could use intersection here, and prove that flags are weaker than implied.  

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


More information about the llvm-commits mailing list