[llvm] [ValueTracking] Support GEPs in matchSimpleRecurrence. (PR #123518)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 03:15:10 PST 2025


================
@@ -9199,6 +9210,17 @@ llvm::canConvertToMinOrMaxIntrinsic(ArrayRef<Value *> VL) {
 
 bool llvm::matchSimpleRecurrence(const PHINode *P, BinaryOperator *&BO,
                                  Value *&Start, Value *&Step) {
+  Instruction *I;
+  if (matchSimpleRecurrence(P, I, Start, Step)) {
+    BO = dyn_cast<BinaryOperator>(I);
+    if (BO)
+      return true;
+  }
+  return false;
+}
----------------
fhahn wrote:

The function is to help during the transitioning phase, to avoid updating all users at the same time outside ValueTracking.cpp

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


More information about the llvm-commits mailing list