[llvm] [IVDescriptors][NFC] Refactor getReductionOpChain to remove the dependency of non-arithmetic reductions on getOpcode. (PR #118777)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 03:33:57 PST 2024


================
@@ -1101,7 +1106,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
     return nullptr;
   };
   auto isCorrectOpcode = [&](Instruction *Cur) {
-    if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp) {
+    if (!IsArithmetic) {
----------------
artagnon wrote:

This function is called isCorrectOpcode(), and it doesn't check opcode anymore?

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


More information about the llvm-commits mailing list