[llvm] [VPlan] Replace VPWidenCastRecipe by VPInstructionWithType. (PR #129712)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Sun May 3 18:19:07 PDT 2026


================
@@ -1512,14 +1509,40 @@ class VPInstructionWithType : public VPInstruction {
   /// Scalar result type produced by the recipe.
   Type *ResultTy;
 
+  /// Whether the recipe produces a single scalar result (as opposed to a
+  /// vector/wide result with one lane per VF).
+  bool IsSingleScalar;
+
+  /// Returns the default value of IsSingleScalar for \p Opcode: true for
+  /// opcodes that produce a single scalar (loads, casts, vscale).
+  static bool defaultIsSingleScalar(unsigned Opcode) {
+    return Instruction::isCast(Opcode) || Opcode == Instruction::Load ||
+           Opcode == VPInstruction::VScale;
+  }
----------------
artagnon wrote:

:( This is a partial duplication of preservesUniformity in vputils -- I moved it in https://github.com/llvm/llvm-project/pull/195385.

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


More information about the llvm-commits mailing list