[llvm] [VPlanPatternMatch] Introduce m_APInt (PR #159558)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 18 04:50:01 PDT 2025
================
@@ -1592,11 +1592,12 @@ static bool tryToReplaceALMWithWideALM(VPlan &Plan, ElementCount VF,
m_ActiveLaneMask(m_VPValue(Index), m_VPValue(), m_VPValue()));
assert(Index && "Expected index from ActiveLaneMask instruction");
- auto *II = dyn_cast<VPInstruction>(Index);
- if (II && II->getOpcode() == VPInstruction::CanonicalIVIncrementForPart) {
- auto Part = cast<ConstantInt>(II->getOperand(1)->getLiveInIRValue());
+ const APInt *Part;
+ if (match(Index,
+ m_VPInstruction<VPInstruction::CanonicalIVIncrementForPart>(
+ m_VPValue(), m_APInt(Part))))
Phis[Part->getZExtValue()] = Phi;
- } else
----------------
lukel97 wrote:
There was no APInt here before. Do we not want something more like `bind_const_intval_ty m_ConstantInt(uint64_t &V)` from PatternMatch.h?
https://github.com/llvm/llvm-project/pull/159558
More information about the llvm-commits
mailing list