[llvm] [VPlan] Fold common edges away in convertPhisToBlends (PR #150368)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 31 09:28:17 PDT 2025
================
@@ -226,6 +231,20 @@ void VPPredicator::createSwitchEdgeMasks(VPInstruction *SI) {
setEdgeMask(Src, DefaultDst, DefaultMask);
}
+VPValue *VPPredicator::findCommonEdgeMask(const VPWidenPHIRecipe *PhiR) const {
+ using namespace llvm::VPlanPatternMatch;
+ VPValue *EdgeMask = getEdgeMask(PhiR->getIncomingBlock(0), PhiR->getParent());
+ VPValue *CommonEdgeMask;
+ if (!EdgeMask ||
+ !match(EdgeMask, m_LogicalAnd(m_VPValue(CommonEdgeMask), m_VPValue())))
+ return nullptr;
+ for (unsigned In = 1; In < PhiR->getNumIncoming(); In++)
----------------
lukel97 wrote:
Yes but I'm not sure if using seq for regular for loops is part of the loop vectorizer code style to begin with.
I'm aware it's used a lot throughout SLP but I think it would be good to be consistent throughout the loop vectorizer.
https://github.com/llvm/llvm-project/pull/150368
More information about the llvm-commits
mailing list