Skip to content

Commit 8b30ae5

Browse files
fixup! [InstCombine][RISCV] Convert VPIntrinsics with splat operands to splats of the scalar operation
1 parent aefb961 commit 8b30ae5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ bool VectorCombine::scalarizeVPIntrinsic(Instruction &I) {
795795
TTI.getArithmeticInstrCost(ScalarOpcode, VecTy->getScalarType());
796796
// The existing splats may be kept around if other instructions use them.
797797
InstructionCost CostToKeepSplats =
798-
SplatCost * (Op0->getNumUses() + Op1->getNumUses() - 2);
798+
(SplatCost * !Op0->hasOneUse()) + (SplatCost * !Op1->hasOneUse());
799799
InstructionCost NewCost = ScalarOpCost + SplatCost + CostToKeepSplats;
800800

801801
LLVM_DEBUG(dbgs() << "Found a VP Intrinsic to scalarize: " << VPI

0 commit comments

Comments
 (0)