Hey @WG-llvm -- so I want to create this concept of ICE-breakers, and I wanted to start with LLVM bugs. The idea is to pick a topic area (in this case, LLVM) and to prepare:
I was hoping to get two bits of feedback here:
I think an LLVM guide would basically include
(a) some tips on bisecting -- at least just pointing to cargo-bisect rustc and mentioning nightlies etc. This should be generally useful.
(b) some tips on how to do dump LLVM IR -- at least listing out the command line options
(c) maybe some tips on minimization tools?
(d) pointers to the LLVM bug database and a few tips on how to search?
I don't know how people normally go about reducing a bug to an LLVM bug, so any suggestions very welcome. :)
I'd also like to maybe reach out to LLVM people to see if any of them are interested in being added to the alias...
I think the target audience is probably people who are somewhat familiar with LLVM already, most realistically.
Hey @WG-llvm -- can somebody at least point me to some tips on how to see the llvm output when running with rustc? Is
-Zsave-temps still a thing?
--emit LLVM? I want to write up some docs that basically say:
- here is how you dump IR
- then you can debug from there
--emit llvm-bc maybe?
--emit=llvm-ir is what is usually used, sometimes with -Zno-prepopulate-passes.
llvm-bc is also useful, but pretty much equivalent to llvm-ir for all intents and purposes, except you need an additional steps to make it readable.
@nagisa where does the IR appear in that case?
other useful flags are
* allows pretty much everything that tools like
opt would accept e.g. -Cllvm-arg=-print-before-all` to print IR before every LLVM pass.
@nikomatsakis it is output as
<filename>.ll in your output directory.
--emit=link,asm,llvm-ir would output
mycrate (the binary),
I can't find the option
It's a -C option IIRC
Why do you run that?
Like, why would you want to avoid prepopulating the passes list :)
To get the LLVM IR that rustc generates, not what's left after LLVM is done with it
ok, that's what I figured
We have a fork of LLVM, right? With patches?
Where is that located?
https://github.com/rust-lang/llvm-project/ though figuring out which branch/commit we're actually using is more easily achieved by looking at the submodule in the rust-lang/rust.git tree
oh hey, I just found this chapter in the rustc-guide
this contains most everything I was writing