[llvm] [VPlan] Fold common edges away in convertPhisToBlends (PR #150368)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 1 07:14:09 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++)
----------------
fhahn wrote:
This reminded me of https://github.com/llvm/llvm-project/pull/138472.
All you need here are the incoming blocks, right? For the non-header-phis, that should just be the predecessors blocks. It would be clearer with https://github.com/llvm/llvm-project/pull/138472, which provides `incoming_blocks`
https://github.com/llvm/llvm-project/pull/150368
More information about the llvm-commits
mailing list