[llvm] [ValueTracking] isNonEqual Pointers with with a recursive GEP (PR #70459)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 02:54:48 PST 2023


================
@@ -3141,6 +3141,60 @@ static bool isNonEqualSelect(const Value *V1, const Value *V2, unsigned Depth,
          isKnownNonEqual(SI1->getFalseValue(), V2, Depth + 1, Q);
 }
 
+// Check to see if A is both a GEP and is the incoming value for a PHI in the
+// loop, and B is either a ptr or another GEP. If the PHI has 2 incoming values,
+// one of them being the recursive GEP A and the other a ptr at same base and at
+// the same/higher offset than B we are only incrementing the pointer further in
+// loop if offset of recursive GEP is greater than 0.
+static bool isNonEqualPointersWithRecursiveGEP(const Value *A, const Value *B,
+                                               unsigned Depth,
----------------
nikic wrote:

The Depth parameter is unused.

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


More information about the llvm-commits mailing list