Skip to content

Commit 5eadd23

Browse files
committed
fixup! move def close to use.
1 parent de00e4b commit 5eadd23

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,9 +1464,6 @@ void VPWidenCastRecipe::execute(VPTransformState &State) {
14641464

14651465
InstructionCost VPWidenCastRecipe::computeCost(ElementCount VF,
14661466
VPCostContext &Ctx) const {
1467-
auto *SrcTy = cast<VectorType>(
1468-
ToVectorTy(Ctx.Types.inferScalarType(getOperand(0)), VF));
1469-
auto *DestTy = cast<VectorType>(ToVectorTy(getResultType(), VF));
14701467
// Computes the CastContextHint from a recipes that may access memory.
14711468
auto ComputeCCH = [&](const VPRecipeBase *R) -> TTI::CastContextHint {
14721469
if (VF.isScalar())
@@ -1510,6 +1507,10 @@ InstructionCost VPWidenCastRecipe::computeCost(ElementCount VF,
15101507
else if (LoadRecipe)
15111508
CCH = ComputeCCH(LoadRecipe);
15121509
}
1510+
1511+
auto *SrcTy = cast<VectorType>(
1512+
ToVectorTy(Ctx.Types.inferScalarType(getOperand(0)), VF));
1513+
auto *DestTy = cast<VectorType>(ToVectorTy(getResultType(), VF));
15131514
// Arm TTI will use the underlying instruction to determine the cost.
15141515
return Ctx.TTI.getCastInstrCost(
15151516
Opcode, DestTy, SrcTy, CCH, TTI::TCK_RecipThroughput,

0 commit comments

Comments
 (0)