[mlir] Fix bots after bytecode support was added in D131747
authorRiver Riddle <riddleriver@gmail.com>
Mon, 22 Aug 2022 08:31:31 +0000 (01:31 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Mon, 22 Aug 2022 08:31:39 +0000 (01:31 -0700)
* 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)

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

index 3168ce6..c23640d 100644 (file)
@@ -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();
   }
 }
 
index 4424dc7..61fef0e 100644 (file)
@@ -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.
index 2aa30e3..1926fa6 100644 (file)
@@ -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} : () -> ()
index 0508c09..fd9bd33 100644 (file)
@@ -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
 //===--------------------------------------------------------------------===//
index be87e81..561e2f4 100644 (file)
@@ -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
 //===--------------------------------------------------------------------===//
index a39017c..18c8ab7 100644 (file)
@@ -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
 //===--------------------------------------------------------------------===//
index 95d9efd..661ccb1 100644 (file)
@@ -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
 //===--------------------------------------------------------------------===//
index 9a8bc08..7084481 100644 (file)
@@ -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
 //===--------------------------------------------------------------------===//
index aba6b3f..137ff75 100644 (file)
@@ -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
 //===--------------------------------------------------------------------===//