[llvm] [VPlan] Introduce VPInstructionWithType, use instead of VPScalarCast(NFC) (PR #129706)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 6 14:27:03 PDT 2025


================
@@ -1024,6 +1023,53 @@ class VPInstruction : public VPRecipeWithIRFlags,
   StringRef getName() const { return Name; }
 };
 
+/// A specialization of VPInstruction augmenting it with a dedicated result
+/// type, to be used when the opcode and operands of the VPInstruction don't
+/// directly determine the result type.
+class VPInstructionWithType : public VPInstruction {
----------------
fhahn wrote:

I managed to sort this out now using a specialization of `CastInfo`, which allows `isa/dyn_cast<VPWithResultType>` to work, effectively turning it into a mixin/trait.

A sketch is here 5c54367f85012baff703d1ad3cd16478d1982fac,  might be worth doing separately>

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


More information about the llvm-commits mailing list