Skip to content

Conversation

jserv
Copy link
Collaborator

@jserv jserv commented Aug 21, 2025

This implements constant folding during expression parsing to evaluate compile-time constants like "2 + 3" → "5" before IR generation, covering arithmetic, bitwise, and comparison operations with proper error handling. It complement existing SSA optimizer without conflicts.

Summary by Bito

This pull request implements parse-time constant folding in the expression parser, enabling the evaluation of compile-time constants like '2 + 3' to '5'. It also enhances error handling for division and modulo by zero, improving parser robustness while ensuring compatibility with the existing SSA optimizer.

@jserv jserv requested review from ChAoSUnItY and vacantron August 21, 2025 08:53
@jserv jserv force-pushed the parse-time-constfold branch from e05cf72 to 3020534 Compare August 21, 2025 08:56
@jserv jserv requested a review from DrXiao August 21, 2025 13:30
This implements constant folding during expression parsing to evaluate
compile-time constants like "2 + 3" → "5" before IR generation, covering
arithmetic, bitwise, and comparison operations with proper error
handling. It complement existing SSA optimizer without conflicts.
@jserv jserv force-pushed the parse-time-constfold branch from 3020534 to 999b021 Compare August 24, 2025 11:56
@sysprog21 sysprog21 deleted a comment from bito-code-review bot Aug 24, 2025
@jserv jserv merged commit 3ce8ed8 into master Aug 24, 2025
12 checks passed
@jserv jserv deleted the parse-time-constfold branch August 24, 2025 12:03
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