[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:51 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());
+ } else if (Instruction::isBinaryOp(I->getOpcode())) {
+ VPI = new VPInstruction(I->getOpcode(), Operands, VPIRFlags(*I),
+ I->getDebugLoc(), I->getName(), true);
+ }
----------------
fhahn wrote:
Yep
https://github.com/llvm/llvm-project/pull/141429
More information about the llvm-commits
mailing list