[llvm] [ValueTracking] Use Instruction instead of Operator in matchSimpleRecurrence. (PR #74678)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 05:23:57 PST 2023


================
@@ -8024,7 +8024,7 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, BinaryOperator *&BO,
   for (unsigned i = 0; i != 2; ++i) {
     Value *L = P->getIncomingValue(i);
     Value *R = P->getIncomingValue(!i);
-    Operator *LU = dyn_cast<Operator>(L);
+    auto *LU = dyn_cast<Instruction>(L);
----------------
nikic wrote:

You could directly cast to `BinaryOperator` here and then save the `cast<BinaryOperator>(LU)` below.

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


More information about the llvm-commits mailing list