Skip to content

Commit 045fdda

Browse files
committed
[VPlan] Replace TTI::getOperandInfo with Ctx.getOperandInfo (NFC).
Update to use VPlan-based implementation of getOperandInfo, removing uses of underlying IR references.
1 parent 2880859 commit 045fdda

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,10 +1785,7 @@ InstructionCost VPWidenRecipe::computeCost(ElementCount VF,
17851785
VPValue *RHS = getOperand(1);
17861786
// Certain instructions can be cheaper to vectorize if they have a constant
17871787
// second vector operand. One example of this are shifts on x86.
1788-
TargetTransformInfo::OperandValueInfo RHSInfo = {
1789-
TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None};
1790-
if (RHS->isLiveIn())
1791-
RHSInfo = Ctx.TTI.getOperandInfo(RHS->getLiveInIRValue());
1788+
TargetTransformInfo::OperandValueInfo RHSInfo = Ctx.getOperandInfo(RHS);
17921789

17931790
if (RHSInfo.Kind == TargetTransformInfo::OK_AnyValue &&
17941791
getOperand(1)->isDefinedOutsideLoopRegions())
@@ -2888,8 +2885,9 @@ InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
28882885
Cost +=
28892886
Ctx.TTI.getMaskedMemoryOpCost(Opcode, Ty, Alignment, AS, Ctx.CostKind);
28902887
} else {
2891-
TTI::OperandValueInfo OpInfo =
2892-
Ctx.TTI.getOperandInfo(Ingredient.getOperand(0));
2888+
TTI::OperandValueInfo OpInfo = Ctx.getOperandInfo(
2889+
isa<VPWidenLoadRecipe, VPWidenLoadEVLRecipe>(this) ? getOperand(0)
2890+
: getOperand(1));
28932891
Cost += Ctx.TTI.getMemoryOpCost(Opcode, Ty, Alignment, AS, Ctx.CostKind,
28942892
OpInfo, &Ingredient);
28952893
}

0 commit comments

Comments
 (0)