[llvm] [VPlan] Fold common edges away in convertPhisToBlends (PR #150368)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 28 23:33:39 PDT 2025
================
@@ -227,6 +232,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++)
+ if (!match(getEdgeMask(PhiR->getIncomingBlock(In), PhiR->getParent()),
----------------
artagnon wrote:
Not sure if you mean this:
```cpp
assert(In == 0 && "Both null and non-null edge masks found");
assert(all_equal(PhiR->operands()) &&
"Distinct incoming values with one having a full mask");
```
Not sure what this has to do with Map.lookup in getEdgeMask failing?
https://github.com/llvm/llvm-project/pull/150368
More information about the llvm-commits
mailing list