[llvm] [LV] Explicitly disable in-loop reductions for AnyOf and FindIV. nfc (PR #163541)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 02:26:55 PST 2025


================
@@ -1248,6 +1243,13 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
   case RecurKind::FMaximumNum:
   case RecurKind::FMinimumNum:
     return Instruction::FCmp;
+  case RecurKind::AnyOf:
+  case RecurKind::FindFirstIVSMin:
+  case RecurKind::FindFirstIVUMin:
+  case RecurKind::FindLastIVSMax:
+  case RecurKind::FindLastIVUMax:
+    // TODO: Set AnyOf and FindIV to Instruction::Select once in-loop reductions
----------------
Mel-Chen wrote:

> Boolean recurrence chain of AnyOf could indeed contain a Select as in `nextRed = currentCond ? true : prevRed`, but could also contain an Or as in `nextRed = currentCond | prevRed`?
> 
Although this will probably be classified as RecurKind::Or at the moment (if I’m not mistaken), I think introducing `isLegalOpcodeInChain()` should help address this.



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


More information about the llvm-commits mailing list