Skip to content

Minor optimisation#537

Merged
pschachte merged 3 commits intomasterfrom
minoropt
Feb 17, 2026
Merged

Minor optimisation#537
pschachte merged 3 commits intomasterfrom
minoropt

Conversation

@pschachte
Copy link
Owner

BodyBuilder now optimises away equality test for 1 with 1 bit values, taking the compared value as
the result. This reduces the generated LLVM code, though I expect the LLVM optimiser would already do this optimisation. The benefit is that it reduces the generated LPVM code, possibly allowing inlining more often, and maybe benefitting other LPVM optimisations.

This pull also includes an optimisation to remove
llvm and operations applied n-bit values and the
constant 2^n-1. Unfortunately, this triggers a bug in BodyBuilder, so I'm leaving it commented out until I can find and fix the bug.

BodyBuilder now optimises away equality test for 1
with 1 bit values, taking the compared value as
the result.  This reduces the generated LLVM code,
though I expect the LLVM optimiser would already do
this optimisation.  The benefit is that it reduces
the generated LPVM code, possibly allowing inlining
more often, and maybe benefitting other LPVM optimisations.

This pull also includes an optimisation to remove
llvm and operations applied n-bit values and the
constant 2^n-1.  Unfortunately, this triggers a bug
in BodyBuilder, so I'm leaving it commented out until
I can find and fix the bug.
@pschachte pschachte merged commit 53e27d3 into master Feb 17, 2026
2 checks passed
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

Comments