Skip to content

Commit fd4f132

Browse files
committed
unify the constructor of VPWidenStoreEVLRecipe
1 parent d9c5ddc commit fd4f132

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
@@ -3476,20 +3476,11 @@ struct LLVM_ABI_FOR_TEST VPWidenStoreRecipe final : public VPWidenMemoryRecipe {
34763476
/// using the value to store, the address to store to, the explicit vector
34773477
/// length and an optional mask.
34783478
struct VPWidenStoreEVLRecipe final : public VPWidenMemoryRecipe {
3479-
VPWidenStoreEVLRecipe(VPWidenStoreRecipe &S, VPValue *Addr, VPValue &EVL,
3480-
VPValue *Mask)
3481-
: VPWidenMemoryRecipe(VPDef::VPWidenStoreEVLSC, S.getIngredient(),
3482-
{Addr, S.getStoredValue(), &EVL}, S.isConsecutive(),
3483-
S.isReverse(), S, S.getDebugLoc()) {
3484-
setMask(Mask);
3485-
}
3486-
34873479
VPWidenStoreEVLRecipe(VPWidenStoreRecipe &S, VPValue *Addr,
34883480
VPValue *StoredVal, VPValue &EVL, VPValue *Mask)
34893481
: VPWidenMemoryRecipe(VPDef::VPWidenStoreEVLSC, S.getIngredient(),
34903482
{Addr, StoredVal, &EVL}, S.isConsecutive(),
34913483
S.isReverse(), S, S.getDebugLoc()) {
3492-
assert(isReverse() && "Only reverse access need to set new stored value");
34933484
setMask(Mask);
34943485
}
34953486

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

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

2873-
if (match(&CurRecipe, m_MaskedStore(m_VPValue(Addr), m_VPValue(),
2873+
VPValue *StoredVal;
2874+
if (match(&CurRecipe, m_MaskedStore(m_VPValue(Addr), m_VPValue(StoredVal),
28742875
m_RemoveMask(HeaderMask, Mask))) &&
28752876
!cast<VPWidenStoreRecipe>(CurRecipe).isReverse())
28762877
return new VPWidenStoreEVLRecipe(cast<VPWidenStoreRecipe>(CurRecipe), Addr,
2877-
EVL, Mask);
2878+
StoredVal, EVL, Mask);
28782879

28792880
if (match(&CurRecipe,
28802881
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)