File tree 1 file changed +21
-0
lines changed
llvm/unittests/Transforms/Vectorize
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1139,6 +1139,27 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
1139
1139
delete Call;
1140
1140
}
1141
1141
1142
+ {
1143
+ // Test for a call to a function without side-effects.
1144
+ LLVMContext C;
1145
+ Module M (" " , C);
1146
+ Function *TheFn = Intrinsic::getDeclaration (&M, Intrinsic::thread_pointer);
1147
+
1148
+ auto *Call = CallInst::Create (TheFn->getFunctionType (), TheFn);
1149
+ VPValue Op1;
1150
+ VPValue Op2;
1151
+ SmallVector<VPValue *, 2 > Args;
1152
+ Args.push_back (&Op1);
1153
+ Args.push_back (&Op2);
1154
+ VPWidenCallRecipe Recipe (*Call, make_range (Args.begin (), Args.end ()),
1155
+ false );
1156
+ EXPECT_TRUE (Recipe.mayHaveSideEffects ());
1157
+ EXPECT_FALSE (Recipe.mayReadFromMemory ());
1158
+ EXPECT_FALSE (Recipe.mayWriteToMemory ());
1159
+ EXPECT_FALSE (Recipe.mayReadOrWriteMemory ());
1160
+ delete Call;
1161
+ }
1162
+
1142
1163
{
1143
1164
VPValue Op1;
1144
1165
VPValue Op2;
You can’t perform that action at this time.
0 commit comments