Stream: beginners

Topic: Inspecting generated code


view this post on Zulip David Smith (May 09 2023 at 15:55):

Hello,

I'm wondering if there's an easy way to inspect the code generated during compilation, e.g., the LLVM IR. Does this require using a custom roc compiler build? My use case is to be able to understand whether two possible algorithm implementations would result in a functionally identical executable.

Thanks!

view this post on Zulip Brendan Hansknecht (May 09 2023 at 16:01):

--debug will dump llvm ir

view this post on Zulip Brendan Hansknecht (May 09 2023 at 16:01):

It can be quite verbose and hard to follow

view this post on Zulip Brendan Hansknecht (May 09 2023 at 16:01):

Also, it requires a tool called debugir if you want more debug info and compilation to finish.

view this post on Zulip Brendan Hansknecht (May 09 2023 at 16:02):

But you will get a raw dump even without the tool

view this post on Zulip David Smith (May 09 2023 at 16:09):

Sounds like enough to get me started. Thanks!

view this post on Zulip Brendan Hansknecht (May 09 2023 at 16:17):

Also, feel free to ask direct questions here, we may already know the answers to some of your optimization related questions. Of course, won't be as exact as running the llvm optimization and comparing, but it should be pretty close.


Last updated: Jul 05 2025 at 12:14 UTC