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

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 23:08:48 PST 2024


================
@@ -1110,7 +1115,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
     if (isFMulAddIntrinsic(Cur))
       return true;
 
-    return Cur->getOpcode() == RedOp;
+    return Cur->getOpcode() == getOpcode();
----------------
Mel-Chen wrote:

Only arithmetic reductions call getOpcode and check the opcode, non-arithmetic won't reach     this check statement.

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


More information about the llvm-commits mailing list