[mlir][Sol] Support all event arg types in EmitOp lowering#125
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the MLIR-based pipeline’s event emission support by allowing sol.emit to be generated for all Solidity event argument types (including reference types and composite types), and updates/extends the test suite accordingly.
Changes:
- Removed the event-argument type restriction in
SolidityToMLIRPass::genExprsso all event parameter types can flow intosol.emit. - Updated lit/FileCheck codegen tests (init MLIR + EVM lowering) to cover indexed value types, indexed reference types (keccak topic path), anonymous events, and mixed indexed/non-indexed events.
- Added a new MLIR semantic test exercising a broad matrix of event argument types (enums, UDVTs, structs, arrays, bytes/string, contract, external function pointer), and removed now-fixed entries from the MLIR semtest failure list.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/mlirSemtestFailures.txt | Removes event-related (and a few other) tests from the known-MLIR-failures list. |
| test/lit/mlirCodegen/EVM/event.sol | Replaces the simple event with broader coverage and updates the expected EVM-lowered MLIR checks. |
| test/lit/mlirCodegen/EVM/erc20.sol | Updates expected EVM-lowered output around event logging/topic handling to match new lowering behavior. |
| test/lit/mlirCodegen/event.sol | Replaces the simple event with broader coverage and updates expected init-MLIR checks for sol.emit. |
| test/libsolidity/semanticTests/mlir/event_arg_types_all.sol | New semantic test validating event emission across many argument categories and keccak edge cases. |
| libsolidity/codegen/mlir/SolidityToMLIR.cpp | Removes the hardcoded assert limiting event args to integer/address/contract types before creating sol.emit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f65d0e2 to
d529ff0
Compare
1c950ef to
0a72492
Compare
vladimirradosavljevic
approved these changes
May 15, 2026
vladimirradosavljevic
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks!
The literal RHS in bytes.push("c") and bytes.push() = "c" was not cast
to bytes1. Cast it.
0a72492 to
8674095
Compare
d529ff0 to
5c44647
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
matter-labs/solx-llvm#66