@@ -3193,6 +3193,9 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
31933193 // / Whether the consecutive accessed addresses are in reverse order.
31943194 bool Reverse;
31953195
3196+ // / Whether the consecutive accessed addresses are compressed with mask value.
3197+ bool Compressed;
3198+
31963199 // / Whether the memory access is masked.
31973200 bool IsMasked = false ;
31983201
@@ -3206,12 +3209,13 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
32063209
32073210 VPWidenMemoryRecipe (const char unsigned SC, Instruction &I,
32083211 std::initializer_list<VPValue *> Operands,
3209- bool Consecutive, bool Reverse,
3212+ bool Consecutive, bool Reverse, bool Compressed,
32103213 const VPIRMetadata &Metadata, DebugLoc DL)
32113214 : VPRecipeBase(SC, Operands, DL), VPIRMetadata(Metadata), Ingredient(I),
32123215 Alignment (getLoadStoreAlignment(&I)), Consecutive(Consecutive),
3213- Reverse(Reverse) {
3216+ Reverse(Reverse), Compressed(Compressed) {
32143217 assert ((Consecutive || !Reverse) && " Reverse implies consecutive" );
3218+ assert ((Consecutive || !Compressed) && " Compressed implies consecutive" );
32153219 assert (isa<VPVectorEndPointerRecipe>(getAddr ()) ||
32163220 !Reverse &&
32173221 " Reversed acccess without VPVectorEndPointerRecipe address?" );
@@ -3241,6 +3245,9 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
32413245 // / order.
32423246 bool isReverse () const { return Reverse; }
32433247
3248+ // / Return whether the consecutive loaded/stored addresses are compressed.
3249+ bool isCompressed () const { return Compressed; }
3250+
32443251 // / Return the address accessed by this recipe.
32453252 VPValue *getAddr () const { return getOperand (0 ); }
32463253
@@ -3274,18 +3281,18 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
32743281struct LLVM_ABI_FOR_TEST VPWidenLoadRecipe final : public VPWidenMemoryRecipe,
32753282 public VPValue {
32763283 VPWidenLoadRecipe (LoadInst &Load, VPValue *Addr, VPValue *Mask,
3277- bool Consecutive, bool Reverse,
3284+ bool Consecutive, bool Reverse, bool Compressed,
32783285 const VPIRMetadata &Metadata, DebugLoc DL)
32793286 : VPWidenMemoryRecipe(VPDef::VPWidenLoadSC, Load, {Addr}, Consecutive,
3280- Reverse, Metadata, DL),
3287+ Reverse, Compressed, Metadata, DL),
32813288 VPValue (this , &Load) {
32823289 setMask (Mask);
32833290 }
32843291
32853292 VPWidenLoadRecipe *clone () override {
32863293 return new VPWidenLoadRecipe (cast<LoadInst>(Ingredient), getAddr (),
3287- getMask (), Consecutive, Reverse, * this ,
3288- getDebugLoc ());
3294+ getMask (), Consecutive, Reverse, Compressed ,
3295+ * this , getDebugLoc ());
32893296 }
32903297
32913298 VP_CLASSOF_IMPL (VPDef::VPWidenLoadSC);
@@ -3316,8 +3323,8 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
33163323 VPWidenLoadEVLRecipe (VPWidenLoadRecipe &L, VPValue *Addr, VPValue &EVL,
33173324 VPValue *Mask)
33183325 : VPWidenMemoryRecipe(VPDef::VPWidenLoadEVLSC, L.getIngredient(),
3319- {Addr, &EVL}, L.isConsecutive(), L.isReverse(), L,
3320- L.getDebugLoc()),
3326+ {Addr, &EVL}, L.isConsecutive(), L.isReverse(),
3327+ L.isCompressed(), L, L. getDebugLoc()),
33213328 VPValue (this , &getIngredient ()) {
33223329 setMask (Mask);
33233330 }
@@ -3355,16 +3362,16 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
33553362struct LLVM_ABI_FOR_TEST VPWidenStoreRecipe final : public VPWidenMemoryRecipe {
33563363 VPWidenStoreRecipe (StoreInst &Store, VPValue *Addr, VPValue *StoredVal,
33573364 VPValue *Mask, bool Consecutive, bool Reverse,
3358- const VPIRMetadata &Metadata, DebugLoc DL)
3365+ bool Compressed, const VPIRMetadata &Metadata, DebugLoc DL)
33593366 : VPWidenMemoryRecipe(VPDef::VPWidenStoreSC, Store, {Addr, StoredVal},
3360- Consecutive, Reverse, Metadata, DL) {
3367+ Consecutive, Reverse, Compressed, Metadata, DL) {
33613368 setMask (Mask);
33623369 }
33633370
33643371 VPWidenStoreRecipe *clone () override {
33653372 return new VPWidenStoreRecipe (cast<StoreInst>(Ingredient), getAddr (),
33663373 getStoredValue (), getMask (), Consecutive,
3367- Reverse, *this , getDebugLoc ());
3374+ Reverse, Compressed, *this , getDebugLoc ());
33683375 }
33693376
33703377 VP_CLASSOF_IMPL (VPDef::VPWidenStoreSC);
@@ -3399,7 +3406,8 @@ struct VPWidenStoreEVLRecipe final : public VPWidenMemoryRecipe {
33993406 VPValue *Mask)
34003407 : VPWidenMemoryRecipe(VPDef::VPWidenStoreEVLSC, S.getIngredient(),
34013408 {Addr, S.getStoredValue (), &EVL}, S.isConsecutive(),
3402- S.isReverse(), S, S.getDebugLoc()) {
3409+ S.isReverse(), S.isCompressed(), S,
3410+ S.getDebugLoc()) {
34033411 setMask (Mask);
34043412 }
34053413
0 commit comments