[llvm] [SLPVectorizer] Refactor HorizontalReduction::createOp (NFC) (PR #121549)

Han-Kuan Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 01:31:50 PST 2025


================
@@ -19357,59 +19357,43 @@ class HorizontalReduction {
   /// Creates reduction operation with the current opcode.
   static Value *createOp(IRBuilderBase &Builder, RecurKind Kind, Value *LHS,
                          Value *RHS, const Twine &Name, bool UseSelect) {
-    unsigned RdxOpcode = RecurrenceDescriptor::getOpcode(Kind);
+    if (UseSelect) {
+      if (RecurrenceDescriptor::isIntMinMaxRecurrenceKind(Kind)) {
+        CmpInst::Predicate Pred = llvm::getMinMaxReductionPredicate(Kind);
+        Value *Cmp = Builder.CreateCmp(Pred, LHS, RHS, Name);
----------------
HanKuanChen wrote:

`Builder.CreateICmp`?

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


More information about the llvm-commits mailing list