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

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 09:41:29 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;
----------------
goldsteinn wrote:

`return isa<BinaryOperator>(I);`?

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


More information about the llvm-commits mailing list