@@ -2722,7 +2722,6 @@ InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
27222722}
27232723
27242724void VPWidenLoadRecipe::execute (VPTransformState &State) {
2725- auto *LI = cast<LoadInst>(&Ingredient);
27262725
27272726 Type *ScalarDataTy = getLoadStoreType (&Ingredient);
27282727 auto *DataTy = VectorType::get (ScalarDataTy, State.VF );
@@ -2752,7 +2751,7 @@ void VPWidenLoadRecipe::execute(VPTransformState &State) {
27522751 NewLI = Builder.CreateAlignedLoad (DataTy, Addr, Alignment, " wide.load" );
27532752 }
27542753 // Add metadata to the load, but setVectorValue to the reverse shuffle.
2755- State.addMetadata (NewLI, LI );
2754+ State.addMetadata (NewLI, cast<LoadInst>(&Ingredient) );
27562755 if (Reverse)
27572756 NewLI = Builder.CreateVectorReverse (NewLI, " reverse" );
27582757 State.set (this , NewLI);
@@ -2780,7 +2779,6 @@ static Instruction *createReverseEVL(IRBuilderBase &Builder, Value *Operand,
27802779}
27812780
27822781void VPWidenLoadEVLRecipe::execute (VPTransformState &State) {
2783- auto *LI = cast<LoadInst>(&Ingredient);
27842782
27852783 Type *ScalarDataTy = getLoadStoreType (&Ingredient);
27862784 auto *DataTy = VectorType::get (ScalarDataTy, State.VF );
@@ -2812,7 +2810,7 @@ void VPWidenLoadEVLRecipe::execute(VPTransformState &State) {
28122810 }
28132811 NewLI->addParamAttr (
28142812 0 , Attribute::getWithAlignment (NewLI->getContext (), Alignment));
2815- State.addMetadata (NewLI, LI );
2813+ State.addMetadata (NewLI, cast<LoadInst>(&Ingredient) );
28162814 Instruction *Res = NewLI;
28172815 if (isReverse ())
28182816 Res = createReverseEVL (Builder, Res, EVL, " vp.reverse" );
@@ -2855,8 +2853,6 @@ void VPWidenLoadEVLRecipe::print(raw_ostream &O, const Twine &Indent,
28552853#endif
28562854
28572855void VPWidenStoreRecipe::execute (VPTransformState &State) {
2858- auto *SI = cast<StoreInst>(&Ingredient);
2859-
28602856 VPValue *StoredVPValue = getStoredValue ();
28612857 bool CreateScatter = !isConsecutive ();
28622858 const Align Alignment = getLoadStoreAlignment (&Ingredient);
@@ -2888,7 +2884,7 @@ void VPWidenStoreRecipe::execute(VPTransformState &State) {
28882884 NewSI = Builder.CreateMaskedStore (StoredVal, Addr, Alignment, Mask);
28892885 else
28902886 NewSI = Builder.CreateAlignedStore (StoredVal, Addr, Alignment);
2891- State.addMetadata (NewSI, SI );
2887+ State.addMetadata (NewSI, cast<StoreInst>(&Ingredient) );
28922888}
28932889
28942890#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
@@ -2900,7 +2896,6 @@ void VPWidenStoreRecipe::print(raw_ostream &O, const Twine &Indent,
29002896#endif
29012897
29022898void VPWidenStoreEVLRecipe::execute (VPTransformState &State) {
2903- auto *SI = cast<StoreInst>(&Ingredient);
29042899
29052900 VPValue *StoredValue = getStoredValue ();
29062901 bool CreateScatter = !isConsecutive ();
@@ -2935,7 +2930,7 @@ void VPWidenStoreEVLRecipe::execute(VPTransformState &State) {
29352930 }
29362931 NewSI->addParamAttr (
29372932 1 , Attribute::getWithAlignment (NewSI->getContext (), Alignment));
2938- State.addMetadata (NewSI, SI );
2933+ State.addMetadata (NewSI, cast<StoreInst>(&Ingredient) );
29392934}
29402935
29412936InstructionCost VPWidenStoreEVLRecipe::computeCost (ElementCount VF,
0 commit comments