@@ -3055,8 +3055,7 @@ void VPPredInstPHIRecipe::print(raw_ostream &O, const Twine &Indent,
3055
3055
InstructionCost VPWidenMemoryRecipe::computeCost (ElementCount VF,
3056
3056
VPCostContext &Ctx) const {
3057
3057
Type *Ty = toVectorTy (getLoadStoreType (&Ingredient), VF);
3058
- const Align Alignment =
3059
- getLoadStoreAlignment (const_cast <Instruction *>(&Ingredient));
3058
+ const Align Alignment = getLoadStoreAlignment (&Ingredient);
3060
3059
unsigned AS = cast<PointerType>(Ctx.Types .inferScalarType (getAddr ()))
3061
3060
->getAddressSpace ();
3062
3061
unsigned Opcode = isa<VPWidenLoadRecipe, VPWidenLoadEVLRecipe>(this )
@@ -3196,10 +3195,8 @@ InstructionCost VPWidenLoadEVLRecipe::computeCost(ElementCount VF,
3196
3195
// TODO: Using getMemoryOpCost() instead of getMaskedMemoryOpCost when we
3197
3196
// don't need to compare to the legacy cost model.
3198
3197
Type *Ty = toVectorTy (getLoadStoreType (&Ingredient), VF);
3199
- const Align Alignment =
3200
- getLoadStoreAlignment (const_cast <Instruction *>(&Ingredient));
3201
- unsigned AS =
3202
- getLoadStoreAddressSpace (const_cast <Instruction *>(&Ingredient));
3198
+ const Align Alignment = getLoadStoreAlignment (&Ingredient);
3199
+ unsigned AS = getLoadStoreAddressSpace (&Ingredient);
3203
3200
InstructionCost Cost = Ctx.TTI .getMaskedMemoryOpCost (
3204
3201
Instruction::Load, Ty, Alignment, AS, Ctx.CostKind );
3205
3202
if (!Reverse)
@@ -3309,10 +3306,8 @@ InstructionCost VPWidenStoreEVLRecipe::computeCost(ElementCount VF,
3309
3306
// TODO: Using getMemoryOpCost() instead of getMaskedMemoryOpCost when we
3310
3307
// don't need to compare to the legacy cost model.
3311
3308
Type *Ty = toVectorTy (getLoadStoreType (&Ingredient), VF);
3312
- const Align Alignment =
3313
- getLoadStoreAlignment (const_cast <Instruction *>(&Ingredient));
3314
- unsigned AS =
3315
- getLoadStoreAddressSpace (const_cast <Instruction *>(&Ingredient));
3309
+ const Align Alignment = getLoadStoreAlignment (&Ingredient);
3310
+ unsigned AS = getLoadStoreAddressSpace (&Ingredient);
3316
3311
InstructionCost Cost = Ctx.TTI .getMaskedMemoryOpCost (
3317
3312
Instruction::Store, Ty, Alignment, AS, Ctx.CostKind );
3318
3313
if (!Reverse)
0 commit comments