[Mlir-commits] [mlir] 93cf0e8 - [mlir] Fix bots after bytecode support was added in D131747

River Riddle llvmlistbot at llvm.org
Mon Aug 22 01:31:55 PDT 2022


Author: River Riddle
Date: 2022-08-22T01:31:39-07:00
New Revision: 93cf0e8a28e8c682f65d3e5c394d1eb169ca09ce

URL: https://github.com/llvm/llvm-project/commit/93cf0e8a28e8c682f65d3e5c394d1eb169ca09ce
DIFF: https://github.com/llvm/llvm-project/commit/93cf0e8a28e8c682f65d3e5c394d1eb169ca09ce.diff

LOG: [mlir] Fix bots after bytecode support was added in D131747

* Fix ambiguous Twine constructor call
* Ensure shift is 64-bit (for MSVC)
* Disable bytecode tests on s390x (we don't support big endian right now)

Added: 
    

Modified: 
    mlir/lib/Bytecode/Reader/BytecodeReader.cpp
    mlir/lib/Bytecode/Writer/IRNumbering.cpp
    mlir/test/Bytecode/general.mlir
    mlir/test/Bytecode/invalid/invalid-dialect_section.mlir
    mlir/test/Bytecode/invalid/invalid-ir_section.mlir
    mlir/test/Bytecode/invalid/invalid-string_section.mlir
    mlir/test/Bytecode/invalid/invalid-structure.mlir
    mlir/test/Bytecode/invalid/invalid_attr_type_offset_section.mlir
    mlir/test/Bytecode/invalid/invalid_attr_type_section.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
index 3168ce6f9c2f..c23640d1cfa0 100644
--- a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
+++ b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
@@ -40,7 +40,7 @@ static std::string toString(bytecode::Section::ID sectionID) {
   case bytecode::Section::kIR:
     return "IR (4)";
   default:
-    return ("Unknown (" + Twine(sectionID) + ")").str();
+    return ("Unknown (" + Twine(static_cast<unsigned>(sectionID)) + ")").str();
   }
 }
 

diff  --git a/mlir/lib/Bytecode/Writer/IRNumbering.cpp b/mlir/lib/Bytecode/Writer/IRNumbering.cpp
index 4424dc70a73a..61fef0e35cbb 100644
--- a/mlir/lib/Bytecode/Writer/IRNumbering.cpp
+++ b/mlir/lib/Bytecode/Writer/IRNumbering.cpp
@@ -42,7 +42,7 @@ static void groupByDialectPerByte(T range) {
     // Update the number of elements in the current byte grouping. Reminder
     // that varint encodes 7-bits per byte, so that's how we compute the
     // number of elements in each byte grouping.
-    elementsInByteGroup = (1 << (7 * i)) - elementsInByteGroup;
+    elementsInByteGroup = (1ULL << (7ULL * i)) - elementsInByteGroup;
 
     // Slice out the sub-set of elements that are in the current byte grouping
     // to be sorted.

diff  --git a/mlir/test/Bytecode/general.mlir b/mlir/test/Bytecode/general.mlir
index 2aa30e3de269..1926fa652f17 100644
--- a/mlir/test/Bytecode/general.mlir
+++ b/mlir/test/Bytecode/general.mlir
@@ -1,5 +1,8 @@
 // RUN: mlir-opt -allow-unregistered-dialect -emit-bytecode %s | mlir-opt -allow-unregistered-dialect | FileCheck %s
 
+// Bytecode currently does not support big-endian platforms
+// XFAIL: s390x-
+
 // CHECK-LABEL: "bytecode.test1"
 // CHECK-NEXT:    "bytecode.empty"() : () -> ()
 // CHECK-NEXT:    "bytecode.attributes"() {attra = 10 : i64, attrb = #bytecode.attr} : () -> ()

diff  --git a/mlir/test/Bytecode/invalid/invalid-dialect_section.mlir b/mlir/test/Bytecode/invalid/invalid-dialect_section.mlir
index 0508c0966710..fd9bd33f91fb 100644
--- a/mlir/test/Bytecode/invalid/invalid-dialect_section.mlir
+++ b/mlir/test/Bytecode/invalid/invalid-dialect_section.mlir
@@ -1,6 +1,9 @@
 // This file contains various failure test cases related to the structure of
 // the dialect section.
 
+// Bytecode currently does not support big-endian platforms
+// XFAIL: s390x-
+
 //===--------------------------------------------------------------------===//
 // Dialect Name
 //===--------------------------------------------------------------------===//

diff  --git a/mlir/test/Bytecode/invalid/invalid-ir_section.mlir b/mlir/test/Bytecode/invalid/invalid-ir_section.mlir
index be87e81bdd5f..561e2f45839c 100644
--- a/mlir/test/Bytecode/invalid/invalid-ir_section.mlir
+++ b/mlir/test/Bytecode/invalid/invalid-ir_section.mlir
@@ -1,6 +1,9 @@
 // This file contains various failure test cases related to the structure of
 // the IR section.
 
+// Bytecode currently does not support big-endian platforms
+// XFAIL: s390x-
+
 //===--------------------------------------------------------------------===//
 // Operations
 //===--------------------------------------------------------------------===//

diff  --git a/mlir/test/Bytecode/invalid/invalid-string_section.mlir b/mlir/test/Bytecode/invalid/invalid-string_section.mlir
index a39017c3375e..18c8ab73bdae 100644
--- a/mlir/test/Bytecode/invalid/invalid-string_section.mlir
+++ b/mlir/test/Bytecode/invalid/invalid-string_section.mlir
@@ -1,6 +1,9 @@
 // This file contains various failure test cases related to the structure of
 // the string section.
 
+// Bytecode currently does not support big-endian platforms
+// XFAIL: s390x-
+
 //===--------------------------------------------------------------------===//
 // Count
 //===--------------------------------------------------------------------===//

diff  --git a/mlir/test/Bytecode/invalid/invalid-structure.mlir b/mlir/test/Bytecode/invalid/invalid-structure.mlir
index 95d9efdfcb63..661ccb17dbf3 100644
--- a/mlir/test/Bytecode/invalid/invalid-structure.mlir
+++ b/mlir/test/Bytecode/invalid/invalid-structure.mlir
@@ -1,6 +1,9 @@
 // This file contains various failure test cases related to the structure of
 // a bytecode file.
 
+// Bytecode currently does not support big-endian platforms
+// XFAIL: s390x-
+
 //===--------------------------------------------------------------------===//
 // Version
 //===--------------------------------------------------------------------===//

diff  --git a/mlir/test/Bytecode/invalid/invalid_attr_type_offset_section.mlir b/mlir/test/Bytecode/invalid/invalid_attr_type_offset_section.mlir
index 9a8bc08e6c25..708448181c18 100644
--- a/mlir/test/Bytecode/invalid/invalid_attr_type_offset_section.mlir
+++ b/mlir/test/Bytecode/invalid/invalid_attr_type_offset_section.mlir
@@ -1,6 +1,9 @@
 // This file contains various failure test cases related to the structure of
 // the attribute/type offset section.
 
+// Bytecode currently does not support big-endian platforms
+// XFAIL: s390x-
+
 //===--------------------------------------------------------------------===//
 // Offset
 //===--------------------------------------------------------------------===//

diff  --git a/mlir/test/Bytecode/invalid/invalid_attr_type_section.mlir b/mlir/test/Bytecode/invalid/invalid_attr_type_section.mlir
index aba6b3fd1a34..137ff75a13f8 100644
--- a/mlir/test/Bytecode/invalid/invalid_attr_type_section.mlir
+++ b/mlir/test/Bytecode/invalid/invalid_attr_type_section.mlir
@@ -1,6 +1,9 @@
 // This file contains various failure test cases related to the structure of
 // the attribute/type offset section.
 
+// Bytecode currently does not support big-endian platforms
+// XFAIL: s390x-
+
 //===--------------------------------------------------------------------===//
 // Index
 //===--------------------------------------------------------------------===//


        


More information about the Mlir-commits mailing list