[llvm] 2ea6ab6 - [llvm][VFABI] Add more testing for LLVM internal mangling.
Francesco Petrogalli via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 9 07:50:11 PST 2019
Author: Francesco Petrogalli
Date: 2019-12-09T15:49:45Z
New Revision: 2ea6ab67779d079d72d4bb363bd35b55cc714485
URL: https://github.com/llvm/llvm-project/commit/2ea6ab67779d079d72d4bb363bd35b55cc714485
DIFF: https://github.com/llvm/llvm-project/commit/2ea6ab67779d079d72d4bb363bd35b55cc714485.diff
LOG: [llvm][VFABI] Add more testing for LLVM internal mangling.
Summary:
The tests cover the internal mangling for:
1. Masked signatures.
2. Scalable signatures.
3. Masked scalable signatures with linear.
Reviewers: andwar
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71146
Added:
Modified:
llvm/unittests/Analysis/VectorFunctionABITest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Analysis/VectorFunctionABITest.cpp b/llvm/unittests/Analysis/VectorFunctionABITest.cpp
index ccf996b1b6ec..6aaa38c7d83a 100644
--- a/llvm/unittests/Analysis/VectorFunctionABITest.cpp
+++ b/llvm/unittests/Analysis/VectorFunctionABITest.cpp
@@ -447,6 +447,45 @@ TEST_F(VFABIParserTest, ParseMaskingAVX512) {
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 {
More information about the llvm-commits
mailing list