Skip to content

[mlir] Add tests for Improve ABI codegen#93

Open
vladimirradosavljevic wants to merge 8 commits intomainfrom
local_mlir_abi_codegen_improvements
Open

[mlir] Add tests for Improve ABI codegen#93
vladimirradosavljevic wants to merge 8 commits intomainfrom
local_mlir_abi_codegen_improvements

Conversation

@vladimirradosavljevic
Copy link
Copy Markdown
Contributor

solx-llvm PR.

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
…fset-based refs

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

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
…ements in encoding

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

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
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 updates and expands the MLIR/EVM codegen and MLIR semantic test suites to cover the “Improve ABI codegen” changes (notably calldata/memory allocation sizing, overflow/stride checks, and ABI encode/decode behavior across more aggregate/storage shapes).

Changes:

  • Update MLIR EVM FileCheck assertions to reflect the new ABI-related codegen patterns (alignment/rounding, overflow checks, and revert payload construction).
  • Extend MLIR semantic tests with additional ABI decode/encode coverage for calldata inputs and nested/static/storage aggregates.
  • Add new targeted semantic test files for ABI tail cleanup and (packed) storage array encoding.

Reviewed changes

Copilot reviewed 58 out of 69 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/lit/mlirCodegen/EVM/tx-block-props.sol Updates EVM MLIR checks to match new allocation/overflow-check codegen in entry path.
test/lit/mlirCodegen/EVM/transient.sol Updates EVM MLIR checks; includes new allocation overflow-check pattern and some revert-path adjustments.
test/lit/mlirCodegen/EVM/this.sol Updates EVM MLIR checks for new calldata copy/allocation logic and overflow checks.
test/lit/mlirCodegen/EVM/struct.sol Updates malloc/codegen checks to include overflow checking and standardized revert payload.
test/lit/mlirCodegen/EVM/storage-scalar.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/storage-fnptr.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/storage-array.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/special-fn.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/send-transfer.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/revert.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/require.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/named-return.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/msg-data.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/modifier.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/library.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/interface.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/inline-asm.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/immutable.sol Updates entry allocation/copy checks with alignment + overflow logic and adjusted immutable handling checks.
test/lit/mlirCodegen/EVM/getter.sol Updates entry allocation/copy checks with alignment + overflow logic; includes a string getter path adjustment.
test/lit/mlirCodegen/EVM/event.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/crypto_hash.sol Updates recover-path checks to include overflow checking around memory-pointer updates.
test/lit/mlirCodegen/EVM/contract-cmp.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/calldata-bytes.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/bytes.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/bool-storage.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/balance.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/assgn.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/assert.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/lit/mlirCodegen/EVM/address-cast.sol Updates entry allocation/copy checks with alignment + overflow logic.
test/libsolidity/semanticTests/mlir/invalid-abi.sol Adds new invalid calldata ABI decode/encode cases (dynamic + nested fixed/dynamic arrays).
test/libsolidity/semanticTests/mlir/enum.sol Adjusts expected failure output for invalid enum input in id.
test/libsolidity/semanticTests/mlir/abi.sol Adds calldata variants for abi.decode and adds nested static array encode coverage.
test/libsolidity/semanticTests/mlir/abi-encode-tail-cleanup.sol New semantic test ensuring ABI encode/encodePacked zeroes tail padding even when reusing dirty memory.
test/libsolidity/semanticTests/mlir/abi-encode-struct.sol Extends struct ABI encoding coverage including storage big/nested structs and struct arrays.
test/libsolidity/semanticTests/mlir/abi-encode-storage-array.sol New semantic tests for abi.encode over multiple storage array shapes (static/dynamic, nested, struct arrays).
test/libsolidity/semanticTests/mlir/abi-encode-packed-storage-array.sol New semantic tests for abi.encodePacked over storage arrays with varying element widths and sizes.
test/libsolidity/semanticTests/mlir/abi-encode-packed-nested-fixed-array.sol New semantic tests for abi.encodePacked over nested fixed arrays across memory/calldata/storage.

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

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.

2 participants