Skip to content

perf(cbv): drop a dead let binding without evaluating its value - #1217

Merged
strub merged 1 commit into
mainfrom
fix/dead-let-cbv
Oct 26, 2026
Merged

strub merged 1 commit into
mainfrom
fix/dead-let-cbv

Conversation

@strub

@strub strub commented Oct 26, 2026

Copy link
Copy Markdown
Member

Second of a stack of three performance fixes (after #1216) found while checking safety proofs of Jasmin AVX2 implementations.

The call-by-value normaliser evaluated the value of every let binding before its body. A binding introduced by wp for a dead assignment (the flags of an x86 instruction, a register accumulated across an unrolled loop) had its value fully evaluated before being discarded; on 256-bit vector code this took minutes where the rest of the goal takes seconds. A binding none of whose variables occurs in the body is now dropped at once, and a preliminary pass drops the dead bindings of the goal from the inside out, so that a chain of bindings only feeding a dead one disappears as well.

tests/reduction-dead-let.ec gains the same cases proved by cbv.

@strub strub added the stacked Intermediate PR of a stack: CI skipped unless it targets main label Oct 26, 2026
@strub
strub added this pull request to stack #1219 October 26, 2026 08:29
@strub
strub force-pushed the fix/dead-let-cbv branch 2 times, most recently from 5b02c9f to 31edecf Compare October 26, 2026 12:05
Comment thread src/ecCallbyValue.ml
@strub strub removed the stacked Intermediate PR of a stack: CI skipped unless it targets main label Oct 26, 2026
@strub
strub enabled stacked auto-merge October 26, 2026 14:38
@strub
strub added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 26, 2026
Base automatically changed from fix/dead-let-reduction to main October 26, 2026 16:02
The call-by-value normaliser evaluated the value of every let binding
before its body. A binding introduced by wp for a dead assignment (the
flags of an x86 instruction, a register accumulated across an unrolled
loop) had its value fully evaluated before being discarded; on 256-bit
vector code this took minutes where the rest of the goal takes seconds.
A binding none of whose variables occurs in the body is now dropped at
once, and a preliminary pass drops the dead bindings of the goal from
the inside out, so that a chain of bindings only feeding a dead one
disappears as well.
@strub
strub merged commit 93f7c28 into main Oct 26, 2026
5 checks passed
@strub
strub deleted the fix/dead-let-cbv branch October 26, 2026 16:06
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