[PATCH] D71146: [llvm][VFABI] Add more testing for LLVM internal mangling.
Francesco Petrogalli via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 12:52:58 PST 2019
fpetrogalli created this revision.
fpetrogalli added a reviewer: andwar.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
The tests cover the internal mangling for:
1. Masked signatures.
2. Scalable signatures.
3. Masked scalable signatures with linear.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D71146
Files:
llvm/unittests/Analysis/VectorFunctionABITest.cpp
Index: llvm/unittests/Analysis/VectorFunctionABITest.cpp
===================================================================
--- llvm/unittests/Analysis/VectorFunctionABITest.cpp
+++ llvm/unittests/Analysis/VectorFunctionABITest.cpp
@@ -447,6 +447,45 @@
EXPECT_EQ(ScalarName, "sin");
}
+TEST_F(VFABIParserTest, ParseMaskingLLVM) {
+ EXPECT_TRUE(invokeParser("_ZGV_LLVM_M2v_sin(custom_vector_sin)"));
+ EXPECT_EQ(VF, (unsigned)2);
+ EXPECT_TRUE(IsMasked());
+ EXPECT_FALSE(IsScalable);
+ EXPECT_EQ(ISA, VFISAKind::LLVM);
+ EXPECT_EQ(Parameters.size(), (unsigned)2);
+ EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::Vector}));
+ EXPECT_EQ(Parameters[1], VFParameter({1, VFParamKind::GlobalPredicate}));
+ EXPECT_EQ(ScalarName, "sin");
+ EXPECT_EQ(VectorName, "custom_vector_sin");
+}
+
+TEST_F(VFABIParserTest, ParseScalableMaskingLLVM) {
+ EXPECT_TRUE(invokeParser("_ZGV_LLVM_Mxv_sin(custom_vector_sin)"));
+ EXPECT_TRUE(IsMasked());
+ EXPECT_TRUE(IsScalable);
+ EXPECT_EQ(ISA, VFISAKind::LLVM);
+ EXPECT_EQ(Parameters.size(), (unsigned)2);
+ EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::Vector}));
+ EXPECT_EQ(Parameters[1], VFParameter({1, VFParamKind::GlobalPredicate}));
+ EXPECT_EQ(ScalarName, "sin");
+ EXPECT_EQ(VectorName, "custom_vector_sin");
+}
+
+TEST_F(VFABIParserTest, ParseScalableMaskingLLVMSincos) {
+ EXPECT_TRUE(invokeParser("_ZGV_LLVM_Mxvl8l8_sincos(custom_vector_sincos)"));
+ EXPECT_TRUE(IsMasked());
+ EXPECT_TRUE(IsScalable);
+ EXPECT_EQ(ISA, VFISAKind::LLVM);
+ EXPECT_EQ(Parameters.size(), (unsigned)4);
+ EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::Vector}));
+ EXPECT_EQ(Parameters[1], VFParameter({1, VFParamKind::OMP_Linear, 8}));
+ EXPECT_EQ(Parameters[2], VFParameter({2, VFParamKind::OMP_Linear, 8}));
+ EXPECT_EQ(Parameters[3], VFParameter({3, VFParamKind::GlobalPredicate}));
+ EXPECT_EQ(ScalarName, "sincos");
+ EXPECT_EQ(VectorName, "custom_vector_sincos");
+}
+
class VFABIAttrTest : public testing::Test {
protected:
void SetUp() override {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71146.232632.patch
Type: text/x-patch
Size: 2046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191206/e2ec815c/attachment.bin>
More information about the llvm-commits
mailing list