@@ -3179,6 +3179,9 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
31793179protected:
31803180 Instruction &Ingredient;
31813181
3182+ // / Alignment information for this memory access.
3183+ Align Alignment;
3184+
31823185 // / Whether the accessed addresses are consecutive.
31833186 bool Consecutive;
31843187
@@ -3198,10 +3201,10 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
31983201
31993202 VPWidenMemoryRecipe (const char unsigned SC, Instruction &I,
32003203 std::initializer_list<VPValue *> Operands,
3201- bool Consecutive, bool Reverse,
3204+ bool Consecutive, bool Reverse, Align Alignment,
32023205 const VPIRMetadata &Metadata, DebugLoc DL)
32033206 : VPRecipeBase(SC, Operands, DL), VPIRMetadata(Metadata), Ingredient(I),
3204- Consecutive (Consecutive), Reverse(Reverse) {
3207+ Alignment (Alignment), Consecutive(Consecutive), Reverse(Reverse) {
32053208 assert ((Consecutive || !Reverse) && " Reverse implies consecutive" );
32063209 }
32073210
@@ -3242,6 +3245,9 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
32423245 return isMasked () ? getOperand (getNumOperands () - 1 ) : nullptr ;
32433246 }
32443247
3248+ // / Returns the alignment of the memory access.
3249+ Align getAlign () const { return Alignment; }
3250+
32453251 // / Generate the wide load/store.
32463252 void execute (VPTransformState &State) override {
32473253 llvm_unreachable (" VPWidenMemoryRecipe should not be instantiated." );
@@ -3259,18 +3265,18 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
32593265struct LLVM_ABI_FOR_TEST VPWidenLoadRecipe final : public VPWidenMemoryRecipe,
32603266 public VPValue {
32613267 VPWidenLoadRecipe (LoadInst &Load, VPValue *Addr, VPValue *Mask,
3262- bool Consecutive, bool Reverse,
3268+ bool Consecutive, bool Reverse, Align Alignment,
32633269 const VPIRMetadata &Metadata, DebugLoc DL)
32643270 : VPWidenMemoryRecipe(VPDef::VPWidenLoadSC, Load, {Addr}, Consecutive,
3265- Reverse, Metadata, DL),
3271+ Reverse, Alignment, Metadata, DL),
32663272 VPValue (this , &Load) {
32673273 setMask (Mask);
32683274 }
32693275
32703276 VPWidenLoadRecipe *clone () override {
32713277 return new VPWidenLoadRecipe (cast<LoadInst>(Ingredient), getAddr (),
3272- getMask (), Consecutive, Reverse, * this ,
3273- getDebugLoc ());
3278+ getMask (), Consecutive, Reverse, getAlign () ,
3279+ * this , getDebugLoc ());
32743280 }
32753281
32763282 VP_CLASSOF_IMPL (VPDef::VPWidenLoadSC);
@@ -3301,8 +3307,8 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
33013307 VPWidenLoadEVLRecipe (VPWidenLoadRecipe &L, VPValue *Addr, VPValue &EVL,
33023308 VPValue *Mask)
33033309 : VPWidenMemoryRecipe(VPDef::VPWidenLoadEVLSC, L.getIngredient(),
3304- {Addr, &EVL}, L.isConsecutive(), L.isReverse(), L,
3305- L.getDebugLoc()),
3310+ {Addr, &EVL}, L.isConsecutive(), L.isReverse(),
3311+ L.getAlign(), L, L. getDebugLoc()),
33063312 VPValue (this , &getIngredient ()) {
33073313 setMask (Mask);
33083314 }
@@ -3340,16 +3346,16 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
33403346struct LLVM_ABI_FOR_TEST VPWidenStoreRecipe final : public VPWidenMemoryRecipe {
33413347 VPWidenStoreRecipe (StoreInst &Store, VPValue *Addr, VPValue *StoredVal,
33423348 VPValue *Mask, bool Consecutive, bool Reverse,
3343- const VPIRMetadata &Metadata, DebugLoc DL)
3349+ Align Alignment, const VPIRMetadata &Metadata, DebugLoc DL)
33443350 : VPWidenMemoryRecipe(VPDef::VPWidenStoreSC, Store, {Addr, StoredVal},
3345- Consecutive, Reverse, Metadata, DL) {
3351+ Consecutive, Reverse, Alignment, Metadata, DL) {
33463352 setMask (Mask);
33473353 }
33483354
33493355 VPWidenStoreRecipe *clone () override {
33503356 return new VPWidenStoreRecipe (cast<StoreInst>(Ingredient), getAddr (),
33513357 getStoredValue (), getMask (), Consecutive,
3352- Reverse, *this , getDebugLoc ());
3358+ Reverse, getAlign (), *this , getDebugLoc ());
33533359 }
33543360
33553361 VP_CLASSOF_IMPL (VPDef::VPWidenStoreSC);
@@ -3384,7 +3390,7 @@ struct VPWidenStoreEVLRecipe final : public VPWidenMemoryRecipe {
33843390 VPValue *Mask)
33853391 : VPWidenMemoryRecipe(VPDef::VPWidenStoreEVLSC, S.getIngredient(),
33863392 {Addr, S.getStoredValue (), &EVL}, S.isConsecutive(),
3387- S.isReverse(), S, S.getDebugLoc()) {
3393+ S.isReverse(), S.getAlign(), S , S.getDebugLoc()) {
33883394 setMask (Mask);
33893395 }
33903396
0 commit comments