@@ -1165,29 +1165,35 @@ TEST_F(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
1165
1165
}
1166
1166
1167
1167
{
1168
+ auto *Add = BinaryOperator::CreateAdd (PoisonValue::get (Int32),
1169
+ PoisonValue::get (Int32));
1168
1170
VPValue *ChainOp = Plan.getOrAddLiveIn (ConstantInt::get (Int32, 1 ));
1169
1171
VPValue *VecOp = Plan.getOrAddLiveIn (ConstantInt::get (Int32, 2 ));
1170
1172
VPValue *CondOp = Plan.getOrAddLiveIn (ConstantInt::get (Int32, 3 ));
1171
- VPReductionRecipe Recipe (RecurrenceDescriptor (), nullptr , ChainOp, CondOp,
1173
+ VPReductionRecipe Recipe (RecurrenceDescriptor (), Add , ChainOp, CondOp,
1172
1174
VecOp, false );
1173
1175
EXPECT_FALSE (Recipe.mayHaveSideEffects ());
1174
1176
EXPECT_FALSE (Recipe.mayReadFromMemory ());
1175
1177
EXPECT_FALSE (Recipe.mayWriteToMemory ());
1176
1178
EXPECT_FALSE (Recipe.mayReadOrWriteMemory ());
1179
+ delete Add;
1177
1180
}
1178
1181
1179
1182
{
1183
+ auto *Add = BinaryOperator::CreateAdd (PoisonValue::get (Int32),
1184
+ PoisonValue::get (Int32));
1180
1185
VPValue *ChainOp = Plan.getOrAddLiveIn (ConstantInt::get (Int32, 1 ));
1181
1186
VPValue *VecOp = Plan.getOrAddLiveIn (ConstantInt::get (Int32, 2 ));
1182
1187
VPValue *CondOp = Plan.getOrAddLiveIn (ConstantInt::get (Int32, 3 ));
1183
- VPReductionRecipe Recipe (RecurrenceDescriptor (), nullptr , ChainOp, CondOp,
1188
+ VPReductionRecipe Recipe (RecurrenceDescriptor (), Add , ChainOp, CondOp,
1184
1189
VecOp, false );
1185
1190
VPValue *EVL = Plan.getOrAddLiveIn (ConstantInt::get (Int32, 4 ));
1186
1191
VPReductionEVLRecipe EVLRecipe (Recipe, *EVL, CondOp);
1187
1192
EXPECT_FALSE (EVLRecipe.mayHaveSideEffects ());
1188
1193
EXPECT_FALSE (EVLRecipe.mayReadFromMemory ());
1189
1194
EXPECT_FALSE (EVLRecipe.mayWriteToMemory ());
1190
1195
EXPECT_FALSE (EVLRecipe.mayReadOrWriteMemory ());
1196
+ delete Add;
1191
1197
}
1192
1198
1193
1199
{
@@ -1529,28 +1535,34 @@ TEST_F(VPRecipeTest, dumpRecipeUnnamedVPValuesNotInPlanOrBlock) {
1529
1535
1530
1536
TEST_F (VPRecipeTest, CastVPReductionRecipeToVPUser) {
1531
1537
IntegerType *Int32 = IntegerType::get (C, 32 );
1538
+ auto *Add = BinaryOperator::CreateAdd (PoisonValue::get (Int32),
1539
+ PoisonValue::get (Int32));
1532
1540
VPValue *ChainOp = getPlan ().getOrAddLiveIn (ConstantInt::get (Int32, 1 ));
1533
1541
VPValue *VecOp = getPlan ().getOrAddLiveIn (ConstantInt::get (Int32, 2 ));
1534
1542
VPValue *CondOp = getPlan ().getOrAddLiveIn (ConstantInt::get (Int32, 3 ));
1535
- VPReductionRecipe Recipe (RecurrenceDescriptor (), nullptr , ChainOp, CondOp,
1543
+ VPReductionRecipe Recipe (RecurrenceDescriptor (), Add , ChainOp, CondOp,
1536
1544
VecOp, false );
1537
1545
EXPECT_TRUE (isa<VPUser>(&Recipe));
1538
1546
VPRecipeBase *BaseR = &Recipe;
1539
1547
EXPECT_TRUE (isa<VPUser>(BaseR));
1548
+ delete Add;
1540
1549
}
1541
1550
1542
1551
TEST_F (VPRecipeTest, CastVPReductionEVLRecipeToVPUser) {
1543
1552
IntegerType *Int32 = IntegerType::get (C, 32 );
1553
+ auto *Add = BinaryOperator::CreateAdd (PoisonValue::get (Int32),
1554
+ PoisonValue::get (Int32));
1544
1555
VPValue *ChainOp = getPlan ().getOrAddLiveIn (ConstantInt::get (Int32, 1 ));
1545
1556
VPValue *VecOp = getPlan ().getOrAddLiveIn (ConstantInt::get (Int32, 2 ));
1546
1557
VPValue *CondOp = getPlan ().getOrAddLiveIn (ConstantInt::get (Int32, 3 ));
1547
- VPReductionRecipe Recipe (RecurrenceDescriptor (), nullptr , ChainOp, CondOp,
1558
+ VPReductionRecipe Recipe (RecurrenceDescriptor (), Add , ChainOp, CondOp,
1548
1559
VecOp, false );
1549
1560
VPValue *EVL = getPlan ().getOrAddLiveIn (ConstantInt::get (Int32, 0 ));
1550
1561
VPReductionEVLRecipe EVLRecipe (Recipe, *EVL, CondOp);
1551
1562
EXPECT_TRUE (isa<VPUser>(&EVLRecipe));
1552
1563
VPRecipeBase *BaseR = &EVLRecipe;
1553
1564
EXPECT_TRUE (isa<VPUser>(BaseR));
1565
+ delete Add;
1554
1566
}
1555
1567
} // namespace
1556
1568
0 commit comments