[PATCH] D132261: [SLP]Do not reduce repeated values, use scalar red ops instead.
Valeriy Dmitriev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 16 16:51:06 PST 2023
vdmitrie added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:13100-13103
+ if (VL.empty()) {
+ unsigned Cnt =
+ SameValuesCounter.lookup(TrackedToOrig.find(VectorizedValue)->second);
+ switch (RdxKind) {
----------------
ABataev wrote:
> vdmitrie wrote:
> > okay :-) that works too
> >
> > just a n.i.t. remark: you could reduce arguments to just these if the code was a dedicated method:
> > (Value *VectorizedValue, IRBuilderBase &Builder, ArrayRef<Value *> VL, unsigned Cnt)
> >
> >
> >
> It is not possible, both SameValuesCounter and TrackedToOrig are used for each elements of VL in the second switch to build correct constant vector.
I don't see that.
Isn't the following is the only use of them in this part (under condition VL.empty())?
` unsigned Cnt =
SameValuesCounter.lookup(TrackedToOrig.find(VectorizedValue)->second);
`
Aha, I even overlooked that you don't actually use VL elements in this part too.
So here are the only essential arguments for it:
(Value *VectorizedValue, IRBuilderBase &Builder, unsigned Cnt)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132261/new/
https://reviews.llvm.org/D132261
More information about the llvm-commits
mailing list