[PATCH] D116554: [VPlan] Add & use utility to check if only the first lane is used.
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 4 03:15:09 PST 2022
david-arm added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:1658
+
+bool VPUtils::onlyFirstLaneDemanded(VPValue *Def) {
+ return all_of(Def->users(), [](VPUser *U) {
----------------
Hi @fhahn, on the face of it this looks like a reasonable change, but I'm just wondering if we're now going to have to update two places in the code when someone makes a change to `isUniformAfterVectorization`. For example, can we guarantee that for all cases where `isUniformAfterVectorization` returns true we will generate a VPReplicateRecipe that is uniform?
During creations of vplans is there a way to assert that if `isUniformAfterVectorization` returns true then VPUtils::onlyFirstLaneDemanded should also be true?
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:2748
+struct VPUtils {
+ VPUtils() = delete;
----------------
Given you can't create an instance of this, does it even need to be a struct? Could you just use a namespace VPUtils instead?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116554/new/
https://reviews.llvm.org/D116554
More information about the llvm-commits
mailing list