Skip to content

More constant propagation and folding.#28520

Merged
mikebenfield merged 1 commit intomainnetfrom
expand-const-prop
Mar 6, 2025
Merged

More constant propagation and folding.#28520
mikebenfield merged 1 commit intomainnetfrom
expand-const-prop

Conversation

@mikebenfield
Copy link
Copy Markdown
Contributor

Const propagate address, array, and struct literals, and fold array and struct accesses when possible.

Fixes #28519

@mikebenfield mikebenfield requested a review from d0cd March 4, 2025 00:25
@d0cd
Copy link
Copy Markdown
Collaborator

d0cd commented Mar 4, 2025

Could we add a test to propagate literal values including addresses?

@mikebenfield
Copy link
Copy Markdown
Contributor Author

See the test prop_literals.leo; also added tuple access during const folding and a test for that.

Comment thread compiler/passes/src/const_propagation/const_propagate_expression.rs Outdated
Copy link
Copy Markdown
Collaborator

@d0cd d0cd left a comment

Choose a reason for hiding this comment

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

LGTM! Left a minor nit for a more verbose error message.

Const propagate address, array, and struct literals,
and fold array, struct accesses, and tuple accesses when possible.

Fixes #28519
@mikebenfield mikebenfield merged commit cfb9d57 into mainnet Mar 6, 2025
@mikebenfield mikebenfield deleted the expand-const-prop branch March 6, 2025 21:24
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.

[Feature] Const propogate address, struct, and array literals.

2 participants