Skip to content

[mlir][Sol] Support all event arg types in EmitOp lowering#125

Merged
abinavpp merged 2 commits into
mainfrom
app-event-arg-types
May 22, 2026
Merged

[mlir][Sol] Support all event arg types in EmitOp lowering#125
abinavpp merged 2 commits into
mainfrom
app-event-arg-types

Conversation

@abinavpp

@abinavpp abinavpp commented May 6, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown

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-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::genExprs so all event parameter types can flow into sol.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.

@vladimirradosavljevic vladimirradosavljevic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

abinavpp added 2 commits May 22, 2026 10:03
The literal RHS in bytes.push("c") and bytes.push() = "c" was not cast
to bytes1. Cast it.
@abinavpp abinavpp force-pushed the app-event-arg-types branch from 0a72492 to 8674095 Compare May 22, 2026 11:08
@abinavpp abinavpp force-pushed the app-bytes-push-cast branch from d529ff0 to 5c44647 Compare May 22, 2026 11:08
Base automatically changed from app-bytes-push-cast to main May 22, 2026 11:54
@abinavpp abinavpp merged commit 999427b into main May 22, 2026
2 checks passed
@abinavpp abinavpp deleted the app-event-arg-types branch May 22, 2026 11:54
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