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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 18 13:00:16 PST 2026


================
@@ -5095,6 +5091,10 @@ void VPlanTransforms::materializeFactors(VPlan &Plan, VPBasicBlock *VectorPH,
   VPValue *MulByUF = Builder.createOverflowingOp(
       Instruction::Mul, {RuntimeVF, UF}, {true, false});
   VFxUF.replaceAllUsesWith(MulByUF);
+
+  assert(Plan.getVF().getNumUsers() == 0 && Plan.getUF().getNumUsers() == 0 &&
+         Plan.getVFxUF().getNumUsers() == 0 &&
+         "VF, UF, and VFxUF not expected to be used");
----------------
fhahn wrote:



Currently there's no such checks, and there is at least one place where we violate the TODO. The assert here doesn't really guard against further mis-use, and it should trivially hold after the RAUW just before.


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


More information about the llvm-commits mailing list