Is there an easy way to make sure only specific builtins get compiled instead of all of them? The goal is to reduce the amount of debug output I have to sift through.
I think there's a list in load
of the builtins that get pre compiled
They should get removed by DCE
We run that even on debug builds (cause compiling less increases speed).
Maybe we aren't marking everything correctly though so some code is staying that shouldn't be.
Gets complicated with lack due to how it treats compiler rt and libc functions
They should get removed by DCE
Where in the compiler does DCE happen?
I know it is expected to happen "for free" in specialize_types
in the new pipeline, I'd expect it to happen in/around mono
But I'm not sure
yeah it's not that we do a pass to delete them, but rather that we start by specializing the entrypoints and only generate IR for things they encounter along the way
so anything that doesn't get encountered in the course of generating the IR for the entrypoints ends up being essentially "eliminated" by virtue of having never had IR generated for it in the next stage because it didn't come up.
Oh, I was talking about llvm dce that deletes uncalled functions and such
ah, I think that only does anything in the case of Zig builtin functions and compiled Roc functions that llvm ended up inlining everywhere
Yeah, I thought was the question though with a specific builtin. So only one zig builtin instead of all N zig builtin.
But yeah, all roc generated mono should be used and thus never dced
Last updated: Jul 06 2025 at 12:14 UTC