We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aefb961 commit 8b30ae5Copy full SHA for 8b30ae5
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -795,7 +795,7 @@ bool VectorCombine::scalarizeVPIntrinsic(Instruction &I) {
795
TTI.getArithmeticInstrCost(ScalarOpcode, VecTy->getScalarType());
796
// The existing splats may be kept around if other instructions use them.
797
InstructionCost CostToKeepSplats =
798
- SplatCost * (Op0->getNumUses() + Op1->getNumUses() - 2);
+ (SplatCost * !Op0->hasOneUse()) + (SplatCost * !Op1->hasOneUse());
799
InstructionCost NewCost = ScalarOpCost + SplatCost + CostToKeepSplats;
800
801
LLVM_DEBUG(dbgs() << "Found a VP Intrinsic to scalarize: " << VPI
0 commit comments