[llvm] [ValueTracking] Clarify KnownBits recurrence code (PR #222266)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 05:39:59 PDT 2026


================
@@ -1819,8 +1819,8 @@ static void computeKnownBitsFromOperator(const Operator *I,
   case Instruction::PHI: {
     const PHINode *P = cast<PHINode>(I);
     BinaryOperator *BO = nullptr;
-    Value *R = nullptr, *L = nullptr;
-    if (matchSimpleRecurrence(P, BO, R, L)) {
+    Value *Start = nullptr, *Step = nullptr;
----------------
antoniofrighetto wrote:

Nit: while at it, I think the conditions below might read better if we had an alias for Known2, for this case?
```suggestion
    Value *Start = nullptr, *Step = nullptr;
    auto &KnownStart = Known2;
```

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


More information about the llvm-commits mailing list