Skip to content

[mlir] Add tests for Support struct types in abi.encode/abi.decode lowering#89

Merged
vladimirradosavljevic merged 2 commits intomainfrom
mlir_abi_structs_support
Mar 23, 2026
Merged

[mlir] Add tests for Support struct types in abi.encode/abi.decode lowering#89
vladimirradosavljevic merged 2 commits intomainfrom
mlir_abi_structs_support

Conversation

@vladimirradosavljevic
Copy link
Copy Markdown
Contributor

solx-llvm PR.

…rrays and structs

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
…wering

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the MLIR/EVM test suite to cover struct handling in abi.encode / abi.decode, and adds additional storage layout regression coverage around packed fixed arrays followed by scalar members.

Changes:

  • Add new lit + semantic tests for struct abi.decode lowering, including nested structs and dynamic members.
  • Add new semantic tests for struct abi.encode across memory/calldata and selected storage cases.
  • Extend existing storage struct/array tests to exercise packed fixed-array edge cases (packed array field followed by scalar field, plus a following scalar to detect layout overlap).

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/lit/mlirCodegen/storage-struct.sol Extends MLIR “init” checks with a packed fixed-array-in-struct + tail scalar case, including guard/pad variables to detect layout overlap.
test/lit/mlirCodegen/EVM/storage-struct.sol Extends EVM lowering checks for the same packed fixed-array + tail scalar storage layout scenario.
test/lit/mlirCodegen/EVM/storage-array.sol Adds a scalar written from staticArr8[1] to validate packed fixed-array element access and subsequent scalar storage write in EVM lowering.
test/lit/mlirCodegen/EVM/abi-decode-struct.sol New lit test file validating EVM lowering for struct ABI decode (memory + calldata, nested + dynamic members).
test/libsolidity/semanticTests/mlir/storage-struct.sol Adds a semantic regression test for a packed fixed-array struct member followed by a scalar member in storage.
test/libsolidity/semanticTests/mlir/invalid-abi.sol Extends invalid ABI semantic coverage to include invalid struct calldata/memory decoding/encoding paths.
test/libsolidity/semanticTests/mlir/abi-encode-struct.sol New semantic test for abi.encode of structs in memory/calldata plus selected storage struct encoding cases.
test/libsolidity/semanticTests/mlir/abi-decode-struct.sol New semantic test for struct ABI decode in memory/calldata, including nested/dynamic members.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@abinavpp abinavpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@vladimirradosavljevic vladimirradosavljevic merged commit b848acf into main Mar 23, 2026
6 checks passed
@vladimirradosavljevic vladimirradosavljevic deleted the mlir_abi_structs_support branch March 23, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants