Skip to content

Inline bignum - #1872

Merged
Bike merged 5 commits into
mainfrom
inline-bignum
Sep 25, 2026
Merged

Bike merged 5 commits into
mainfrom
inline-bignum

Conversation

@Bike

@Bike Bike commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Inlines bignum creation (for fixnum overflow, not generally) and comparisons, which makes some basic loops work much better.

Also turns LLVM-level inlining back on which we have had disabled for several years now. Shouldn't affect debug info since it'll just be local functions anyway.

and teach the compiler a bit about bignums, and expose select
instructions finally
it's fairly common to be able to derive that things are integers
but not necessarily fixnums, e.g. fixnum sums in loops. In that
case it makes sense to give LLVM as much information as we can.
Not sure why this was disabled. I think maybe a holdover from how
we used to do our "intrinsics" as being embedded into the module?
In any case, this lets local functions (in the Lisp sense) be
inlined, including type checkers. Very nice.

I'm leaving the PipelineTuningOptions there in case we want to do
some actual tuning later.
let LLVM know that we're using the index that's bounded, etc.

with this change in place, a basic loop like
(loop for e across x do (print e)) where x is known simple-vector
can be done without any of our intrinsics in the fast path.
It does still use an llvm.sadd but I figure LLVM knows that one
pretty dang well.
@Bike
Bike merged commit 822571e into main Sep 25, 2026
6 checks passed
@Bike
Bike deleted the inline-bignum branch September 25, 2026 21:02
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.

1 participant