This makes the bytecode reader/writer work on big-endian platforms. The only problem was related to encoding of multi-byte integers, where both reader and writer code make implicit assumptions about endianness of the host platform.
This fixes the current test failures on s390x, and in addition allows to remove the UNSUPPORTED markers from all other bytecode-related test cases - they now also all pass on s390x.
Note that there is still one other, unrelated, endian problem regarding decoding of external resources. This is not fixed by this patch, and still causes two tests to fail:
- test/IR/elements-attr-interface.mlir (already marked as XFAIL on s390x)
- Bytecode/./MLIRBytecodeTests/Bytecode/MultiModuleWithResource
The latter unit test currently fails very early due to the bytecode encoding bug fixed here. After this patch, it will still fail, but later on when verifying the contents of the resource. I've now added a GFAIL_SKIP here to get the build bot green on s390x again.
This can probably be deleted now?