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

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 14:50:08 PDT 2025


================
@@ -1023,6 +1022,56 @@ class VPInstruction : public VPRecipeWithIRFlags,
 
   /// Returns the symbolic name assigned to the VPInstruction.
   StringRef getName() const { return Name; }
+
+  /// Return true if \p U is a cast.
+  static bool isCast(const VPUser *U) {
----------------
ayalz wrote:

Seems more natural to have VPUser::isCast() or VPRecipeBase::isCast(), analogous to Instruction::isCast()?
Rather than the static Instruction::isCast(opcode) which takes an opcode as parameter rather than a [VP]User.

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


More information about the llvm-commits mailing list