[PATCH] D157034: [VPlan] Model masked assumes as replicate recipes, drop them (NFCI).
Ayal Zaks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 4 03:21:48 PDT 2023
Ayal added a comment.
Neat cleanup!
================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:14-17
#include "VPlanTransforms.h"
-#include "VPlanDominatorTree.h"
#include "VPRecipeBuilder.h"
#include "VPlanCFG.h"
+#include "VPlanDominatorTree.h"
----------------
================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:484
// of dead recipes.
for (VPRecipeBase &R : make_early_inc_range(reverse(*VPBB))) {
+ if (auto *RepR = dyn_cast<VPReplicateRecipe>(&R)) {
----------------
Worth adding a comment about dropping conditional assumes, for conditions destined to be flattened.
================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:485-487
+ if (auto *RepR = dyn_cast<VPReplicateRecipe>(&R)) {
+ if (RepR->isPredicated() && match(RepR->getUnderlyingInstr(),
+ m_Intrinsic<Intrinsic::assume>())) {
----------------
Would a single if look better?
================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:492
+ }
if (R.mayHaveSideEffects() || any_of(R.definedValues(), [](VPValue *V) {
return V->getNumUsers() > 0;
----------------
(Other, unpredicated) Assumes are not removed because they are considered to have side effects or have droppable users?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157034/new/
https://reviews.llvm.org/D157034
More information about the llvm-commits
mailing list