[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 17:21:02 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);
----------------
vporpo wrote:
> 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.
I think the issue was the BAD_ICMP_PREDICATE. If I understand correctly we should be using VecPred here instead.
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