[Mlir-commits] [mlir] [MLIR][Bytecode] Enforce alignment requirements (PR #157004)
Maksim Levental
llvmlistbot at llvm.org
Thu Sep 4 20:08:59 PDT 2025
================
@@ -281,8 +291,22 @@ class EncodingReader {
// Process the section alignment if present.
if (hasAlignment) {
+ // Read the requested alignment from the bytecode parser.
uint64_t alignment;
- if (failed(parseVarInt(alignment)) || failed(alignTo(alignment)))
+ if (failed(parseVarInt(alignment)))
+ return failure();
+
+ // Check that the requested alignment is less than or equal to the
+ // alignment of the root buffer. If it is not, we cannot safely guarantee
+ // that the specified alignment is globally correct.
+ //
+ // e.g. if the buffer is 8k aligned and the section is 16k aligned,
----------------
makslevental wrote:
nit:
```suggestion
// E.g. if the buffer is 8k aligned and the section is 16k aligned,
```
https://github.com/llvm/llvm-project/pull/157004
More information about the Mlir-commits
mailing list