[llvm] [VPlan] Assert operand correctness at construction. (NFC) (PR #200686)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 06:36:27 PDT 2026


================
@@ -3180,7 +3197,17 @@ class LLVM_ABI_FOR_TEST VPReductionRecipe : public VPRecipeWithIRFlags {
       : VPRecipeWithIRFlags(SC, Operands, Operands[0]->getScalarType(), FMFs,
                             DL),
         RdxKind(RdxKind), Style(Style) {
+    assert(all_of(Operands,
+                  [this](VPValue *VPV) {
+                    return VPV->getScalarType() == getScalarType() ||
+                           (isa<VPInstruction>(VPV) &&
+                            cast<VPInstruction>(VPV)->getOpcode() ==
+                                VPInstruction::ExplicitVectorLength);
----------------
fhahn wrote:

Unfortunately VPlanPatternMatch.h includes `VPlan.h`, so I don't think there's a way to use it here

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


More information about the llvm-commits mailing list