[llvm] [RISCV][CostModel] Updates reduction and shuffle cost (PR #77342)

Shih-Po Hung via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 19:53:43 PST 2024


================
@@ -1358,19 +1358,51 @@ RISCVTTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty,
     return BaseT::getMinMaxReductionCost(IID, Ty, FMF, CostKind);
 
   std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Ty);
-  if (Ty->getElementType()->isIntegerTy(1))
-    // vcpop sequences, see vreduction-mask.ll.  umax, smin actually only
-    // cost 2, but we don't have enough info here so we slightly over cost.
-    return (LT.first - 1) + 3;
+  if (Ty->getElementType()->isIntegerTy(1)) {
----------------
arcbbb wrote:

It is split off in https://github.com/llvm/llvm-project/pull/79401

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


More information about the llvm-commits mailing list