[PATCH] D120439: [SLP] Fix for the min/max intrinsic cost.

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 23 16:17:23 PST 2022


vporpo added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5128
         if (IntrinsicAndUse.second)
-          IntrinsicCost -=
-              TTI->getCmpSelInstrCost(Instruction::ICmp, VecTy, MaskTy,
-                                      CmpInst::BAD_ICMP_PREDICATE, CostKind);
+          IntrinsicCost -= VecCost;
         VecCost = std::min(VecCost, IntrinsicCost);
----------------
ABataev wrote:
> This is not correct, the original code is correct. Need to check more carefully the cause and probably fix the comment.
Yeah you are right. This should subtract the cost of the vectorized compares, not the vectorized selects. Let me look into it again.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120439/new/

https://reviews.llvm.org/D120439



More information about the llvm-commits mailing list