[llvm] [VPlan] Add VPInst::getNumOperandsForOpcode, use to verify in ctor (NFC) (PR #142284)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 04:37:08 PDT 2025


================
@@ -706,13 +706,15 @@ TEST_F(VPBasicBlockTest, reassociateBlocks) {
 
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 TEST_F(VPBasicBlockTest, print) {
-  VPInstruction *TC = new VPInstruction(Instruction::Add, {});
+  VPInstruction *TC = new VPInstruction(Instruction::PHI, {});
----------------
fhahn wrote:

Yes. The tests here just check the various print implementations, the actual opcodes/operands don't matter much, other than matching the print checks.

There's a chicken-egg problem here, as we need to get a VPValue before calling getPlan.

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


More information about the llvm-commits mailing list