[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:19:24 PST 2024


================
@@ -1081,15 +1086,15 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
   // more expensive than out-of-loop reductions, and need to be costed more
   // carefully.
   unsigned ExpectedUses = 1;
-  if (RedOp == Instruction::ICmp || RedOp == Instruction::FCmp)
+  if (!IsArithmetic)
----------------
Mel-Chen wrote:

We can call it as IsNonArithmetic, I think.
82a107d4b172d22f132b49febe4f819efd686327

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


More information about the llvm-commits mailing list