[llvm] 5f423b7 - [llvm-exegesis] Adjust page size in unit tests to fix ppc failures

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 13:11:23 PST 2023


Author: Aiden Grossman
Date: 2023-12-15T13:11:07-08:00
New Revision: 5f423b7d1cb3474168d79827d2305b137be7160b

URL: https://github.com/llvm/llvm-project/commit/5f423b7d1cb3474168d79827d2305b137be7160b
DIFF: https://github.com/llvm/llvm-project/commit/5f423b7d1cb3474168d79827d2305b137be7160b.diff

LOG: [llvm-exegesis] Adjust page size in unit tests to fix ppc failures

The llvm-exegesis unit tests currently fail on PPC after
ceb196d9903f4db7250bbc6c8da13eeae1b85886 landed as the default page size
on most common linux distributions for PPC is 64kb rather than 4kb. This
patch changes the memory mappings to have addresses as multiples of 64kb
rather than multiples of 4kb to fix this issue.

Added: 
    

Modified: 
    llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
index 1638ede7f3d429..505a030675f64c 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/SnippetFileTest.cpp
@@ -147,8 +147,8 @@ TEST_F(X86SnippetFileTest, NoAsmStreamer) {
 TEST_F(X86SnippetFileTest, MemoryDefinitionTestSingleDef) {
   auto Snippets = TestCommon(R"(
     # LLVM-EXEGESIS-MEM-DEF test1 4096 ff
-    # LLVM-EXEGESIS-MEM-MAP test1 8192
-    # LLVM-EXEGESIS-MEM-MAP test1 16384
+    # LLVM-EXEGESIS-MEM-MAP test1 65536
+    # LLVM-EXEGESIS-MEM-MAP test1 131072
     movq $8192, %r10
     movq (%r10), %r11
   )");
@@ -158,16 +158,16 @@ TEST_F(X86SnippetFileTest, MemoryDefinitionTestSingleDef) {
   ASSERT_THAT(Snippet.Key.MemoryValues,
               UnorderedElementsAre(MemoryDefinitionIs("test1", 255, 4096)));
   ASSERT_THAT(Snippet.Key.MemoryMappings,
-              ElementsAre(MemoryMappingIs(8192, "test1"),
-                          MemoryMappingIs(16384, "test1")));
+              ElementsAre(MemoryMappingIs(65536, "test1"),
+                          MemoryMappingIs(131072, "test1")));
 }
 
 TEST_F(X86SnippetFileTest, MemoryDefinitionsTestTwoDef) {
   auto Snippets = TestCommon(R"(
     # LLVM-EXEGESIS-MEM-DEF test1 4096 ff
     # LLVM-EXEGESIS-MEM-DEF test2 4096 100
-    # LLVM-EXEGESIS-MEM-MAP test1 8192
-    # LLVM-EXEGESIS-MEM-MAP test2 16384
+    # LLVM-EXEGESIS-MEM-MAP test1 65536
+    # LLVM-EXEGESIS-MEM-MAP test2 131072
     movq $8192, %r10
     movq (%r10), %r11
   )");
@@ -178,8 +178,8 @@ TEST_F(X86SnippetFileTest, MemoryDefinitionsTestTwoDef) {
               UnorderedElementsAre(MemoryDefinitionIs("test1", 255, 4096),
                                    MemoryDefinitionIs("test2", 256, 4096)));
   ASSERT_THAT(Snippet.Key.MemoryMappings,
-              ElementsAre(MemoryMappingIs(8192, "test1"),
-                          MemoryMappingIs(16384, "test2")));
+              ElementsAre(MemoryMappingIs(65536, "test1"),
+                          MemoryMappingIs(131072, "test2")));
 }
 
 TEST_F(X86SnippetFileTest, MemoryDefinitionMissingParameter) {
@@ -202,7 +202,7 @@ TEST_F(X86SnippetFileTest, MemoryMappingMissingParameters) {
 
 TEST_F(X86SnippetFileTest, MemoryMappingNoDefinition) {
   auto Error = TestCommon(R"(
-    # LLVM-EXEGESIS-MEM-MAP test1 4096
+    # LLVM-EXEGESIS-MEM-MAP test1 65536
   )")
                    .takeError();
   EXPECT_TRUE((bool)Error);


        


More information about the llvm-commits mailing list