Stream: compiler development

Topic: debugging


view this post on Zulip Anton (Jan 27 2025 at 14:37):

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.

view this post on Zulip Ayaz Hafiz (Jan 27 2025 at 14:50):

I think there's a list in load of the builtins that get pre compiled

view this post on Zulip Brendan Hansknecht (Jan 27 2025 at 16:42):

They should get removed by DCE

view this post on Zulip Brendan Hansknecht (Jan 27 2025 at 16:42):

We run that even on debug builds (cause compiling less increases speed).

view this post on Zulip Brendan Hansknecht (Jan 27 2025 at 16:43):

Maybe we aren't marking everything correctly though so some code is staying that shouldn't be.

view this post on Zulip Brendan Hansknecht (Jan 27 2025 at 16:44):

Gets complicated with lack due to how it treats compiler rt and libc functions

view this post on Zulip Anton (Jan 27 2025 at 16:59):

They should get removed by DCE

Where in the compiler does DCE happen?

view this post on Zulip Sam Mohr (Jan 27 2025 at 17:14):

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

view this post on Zulip Sam Mohr (Jan 27 2025 at 17:14):

But I'm not sure

view this post on Zulip Richard Feldman (Jan 27 2025 at 18:25):

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

view this post on Zulip Richard Feldman (Jan 27 2025 at 18:25):

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.

view this post on Zulip Brendan Hansknecht (Jan 27 2025 at 20:16):

Oh, I was talking about llvm dce that deletes uncalled functions and such

view this post on Zulip Richard Feldman (Jan 27 2025 at 22:46):

ah, I think that only does anything in the case of Zig builtin functions and compiled Roc functions that llvm ended up inlining everywhere

view this post on Zulip Brendan Hansknecht (Jan 28 2025 at 00:42):

Yeah, I thought was the question though with a specific builtin. So only one zig builtin instead of all N zig builtin.

view this post on Zulip Brendan Hansknecht (Jan 28 2025 at 00:43):

But yeah, all roc generated mono should be used and thus never dced


Last updated: Jul 06 2025 at 12:14 UTC