[llvm] [VPlan] Use VPInstruction for uniform binops. (PR #141429)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 07:12:52 PDT 2025


================
@@ -8453,6 +8453,21 @@ VPRecipeBuilder::handleReplication(Instruction *I, ArrayRef<VPValue *> Operands,
   assert((Range.Start.isScalar() || !IsUniform || !IsPredicated ||
           (Range.Start.isScalable() && isa<IntrinsicInst>(I))) &&
          "Should not predicate a uniform recipe");
+  if (IsUniform && !IsPredicated) {
+    VPInstruction *VPI = nullptr;
+    if (Instruction::isCast(I->getOpcode())) {
+      VPI = new VPInstructionWithType(I->getOpcode(), Operands, I->getType(),
+                                      VPIRFlags(*I), I->getDebugLoc(),
+                                      I->getName());
----------------
fhahn wrote:

I think that could work, the only question is what to do with `ResultTy` for opcodes that do not need it but are single-scalar (potentially any opcode)

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


More information about the llvm-commits mailing list