[PATCH] D45834: [TTI] Add a hook to TTI for choosing scalarized shuffle-reduction sequence for reduction idiom
Farhana Aleen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 20 17:04:34 PDT 2018
FarhanaAleen updated this revision to Diff 143410.
FarhanaAleen added a comment.
Hi Hideki.
"It looks to me that you are trying to fine-tune the final step of log-2 reduction."
This patch actually tries to generate required sized vectors(precise vector length) for shuffleReduction (where scalarization follows naturally) instead of keeping the starting vector length fixed all the way through which are filled with unnecessary undefs. I agree it was not clear in the previous patch. To make the distinction clear, I've created a separate function called getVariableLengthShuffleReduction() with additional changes.
I am not opposed to do this in the target/Codegen, it's just that the implementation is a little messy since there is no good way to classify scalar operations as opposed to vector operations whereas it can be implemented in a cleaner way at the first place with a TTI hook.
Does it look reasonable to add a TTI hook and allow SLP to generate precise vector length for the shuffle reduction at the first place if target wants that?
https://reviews.llvm.org/D45834
Files:
include/llvm/Analysis/TargetTransformInfo.h
include/llvm/Analysis/TargetTransformInfoImpl.h
include/llvm/Transforms/Utils/LoopUtils.h
lib/Analysis/TargetTransformInfo.cpp
lib/Transforms/Utils/LoopUtils.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45834.143410.patch
Type: text/x-patch
Size: 10020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180421/3c1ec57b/attachment.bin>
More information about the llvm-commits
mailing list