-
Notifications
You must be signed in to change notification settings - Fork 557
debugging.md: Remove wrong claim that LLVM bitcode is not the same as LLVM IR #2613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.
-
This PR is based on an upstream commit that is older than 7 days.
It's recommended to update your branch according to the rustc-dev-guide.
They are the same thing since they can be converted back and forth without loss.
ca9e227 to
0c616b4
Compare
so, these are different formats of the same data, so I would not call them the same thing
your change still looks like an improvement though, other than the commit message
"LLVM IR" is the abstract idea, bitcode being one way to format IR
Just fyi, not all LLVM tooling can handle both.
LLVM bc has magic bytes set, which provide information to certain tools.
I tried to pass llvm IR files to them and the GPU offload tools failed, which back then took me a bit to figure out since I also first thought they'd be interchangeable. I'm not sure if that's worth mentioning.
Strange because on https://llvm.org/docs/LangRef.html#introduction we can read
The three different forms of LLVM are all equivalent.
Maybe what you see is a bug?
I think it's not a bug. The reason I was given was that parsing the full llvm-IR to understand it is an unreasonable amount of work for arbitrary llvm tools, checking the first magic bytes of a .bc file is a much easier and more reasonable requirement.
cc @kevinsala can you confirm that you can not always pass both .ll and .bc files to llvm tools? The openmp slack unfortunately already deleted the discussion. I think Joseph answered back then.
They are the same thing since they can be converted back and forth without loss.
We hint at that in the second bullet point two paragraphs down:
That is also claimed in the last paragraph in this SO answer: https://stackoverflow.com/a/12954198/287761