Skip to content

Commit 7a087d6

Browse files
committed
unify the constructor of VPWidenStoreEVLRecipe
1 parent 2288cc3 commit 7a087d6

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,20 +3478,11 @@ struct LLVM_ABI_FOR_TEST VPWidenStoreRecipe final : public VPWidenMemoryRecipe {
34783478
/// using the value to store, the address to store to, the explicit vector
34793479
/// length and an optional mask.
34803480
struct VPWidenStoreEVLRecipe final : public VPWidenMemoryRecipe {
3481-
VPWidenStoreEVLRecipe(VPWidenStoreRecipe &S, VPValue *Addr, VPValue &EVL,
3482-
VPValue *Mask)
3483-
: VPWidenMemoryRecipe(VPDef::VPWidenStoreEVLSC, S.getIngredient(),
3484-
{Addr, S.getStoredValue(), &EVL}, S.isConsecutive(),
3485-
S.isReverse(), S, S.getDebugLoc()) {
3486-
setMask(Mask);
3487-
}
3488-
34893481
VPWidenStoreEVLRecipe(VPWidenStoreRecipe &S, VPValue *Addr,
34903482
VPValue *StoredVal, VPValue &EVL, VPValue *Mask)
34913483
: VPWidenMemoryRecipe(VPDef::VPWidenStoreEVLSC, S.getIngredient(),
34923484
{Addr, StoredVal, &EVL}, S.isConsecutive(),
34933485
S.isReverse(), S, S.getDebugLoc()) {
3494-
assert(isReverse() && "Only reverse access need to set new stored value");
34953486
setMask(Mask);
34963487
}
34973488

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,11 +2901,12 @@ static VPRecipeBase *optimizeMaskToEVL(VPValue *HeaderMask,
29012901
TypeInfo.inferScalarType(LoadR), {}, {}, DL);
29022902
}
29032903

2904-
if (match(&CurRecipe, m_MaskedStore(m_VPValue(Addr), m_VPValue(),
2904+
VPValue *StoredVal;
2905+
if (match(&CurRecipe, m_MaskedStore(m_VPValue(Addr), m_VPValue(StoredVal),
29052906
m_RemoveMask(HeaderMask, Mask))) &&
29062907
!cast<VPWidenStoreRecipe>(CurRecipe).isReverse())
29072908
return new VPWidenStoreEVLRecipe(cast<VPWidenStoreRecipe>(CurRecipe), Addr,
2908-
EVL, Mask);
2909+
StoredVal, EVL, Mask);
29092910

29102911
if (match(&CurRecipe,
29112912
m_MaskedStore(m_VPValue(EndPtr), m_Reverse(m_VPValue(ReversedVal)),

llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ TEST_F(VPRecipeTest, CastVPWidenStoreEVLRecipeToVPUser) {
12431243
VPValue *Mask = Plan.getOrAddLiveIn(ConstantInt::get(Int32, 2));
12441244
VPWidenStoreRecipe BaseStore(*Store, Addr, StoredVal, Mask, true, false, {},
12451245
{});
1246-
VPWidenStoreEVLRecipe Recipe(BaseStore, Addr, *EVL, Mask);
1246+
VPWidenStoreEVLRecipe Recipe(BaseStore, Addr, StoredVal, *EVL, Mask);
12471247

12481248
checkVPRecipeCastImpl<VPWidenStoreEVLRecipe, VPUser, VPIRMetadata>(&Recipe);
12491249

0 commit comments

Comments
 (0)