[llvm] [VPlan] Strengthen materializeFactors with assert (NFC) (PR #181665)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 16 11:35:23 PST 2026


================
@@ -5095,6 +5091,9 @@ void VPlanTransforms::materializeFactors(VPlan &Plan, VPBasicBlock *VectorPH,
   VPValue *MulByUF = Builder.createOverflowingOp(
       Instruction::Mul, {RuntimeVF, UF}, {true, false});
   VFxUF.replaceAllUsesWith(MulByUF);
+
+  assert(Plan.getVF().getNumUsers() == Plan.getVFxUF().getNumUsers() == 1 &&
----------------
artagnon wrote:

VPlan doesn't differentiate between uses and users, and has no corresponding concept of an IR Use; Plan.getVF() and Plan.getVFxUF() have just been RAUW'ed: the old VPValue is not removed, and hence there is one use, and the corresponding user.

https://github.com/llvm/llvm-project/pull/181665


More information about the llvm-commits mailing list