[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


================
@@ -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)
----------------
artagnon wrote:

Sounds like IsArithmetic needs to be inverted, since we're checking the negation everywhere, but then I wouldn't know what to call the new variable.

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


More information about the llvm-commits mailing list