Stream: t-compiler/wg-llvm

Topic: LLVM ICE-breaker group


nikomatsakis (Sep 10 2019 at 14:58, on Zulip):

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. :)

nikomatsakis (Sep 10 2019 at 14:58, on Zulip):

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...

nikomatsakis (Sep 10 2019 at 14:58, on Zulip):

I think the target audience is probably people who are somewhat familiar with LLVM already, most realistically.

nikomatsakis (Sep 10 2019 at 14:59, on Zulip):

Thoughts?

nikomatsakis (Sep 20 2019 at 19:39, on Zulip):

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

nikomatsakis (Sep 20 2019 at 19:40, on Zulip):

I guess --emit llvm-bc maybe?

nagisa (Sep 20 2019 at 19:40, on Zulip):

--emit=llvm-ir is what is usually used, sometimes with -Zno-prepopulate-passes.

nagisa (Sep 20 2019 at 19:40, on Zulip):

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.

nikomatsakis (Sep 20 2019 at 19:41, on Zulip):

@nagisa where does the IR appear in that case?

nagisa (Sep 20 2019 at 19:41, on Zulip):

other useful flags are -Cllvm-arg=* where * allows pretty much everything that tools like llc and opt would accept e.g. -Cllvm-arg=-print-before-all` to print IR before every LLVM pass.

nagisa (Sep 20 2019 at 19:42, on Zulip):

@nikomatsakis it is output as <filename>.ll in your output directory.

nagisa (Sep 20 2019 at 19:43, on Zulip):

e.g. --emit=link,asm,llvm-ir would output mycrate (the binary), mycrate.s and mycrate.ll.

nikomatsakis (Sep 20 2019 at 19:44, on Zulip):

I can't find the option -Zno-prepopulate-passes

rkruppe (Sep 20 2019 at 19:44, on Zulip):

It's a -C option IIRC

rkruppe (Sep 20 2019 at 19:44, on Zulip):

not -Z

nikomatsakis (Sep 20 2019 at 19:46, on Zulip):

Got it

nikomatsakis (Sep 20 2019 at 19:46, on Zulip):

Why do you run that?

nikomatsakis (Sep 20 2019 at 19:46, on Zulip):

Like, why would you want to avoid prepopulating the passes list :)

rkruppe (Sep 20 2019 at 19:46, on Zulip):

To get the LLVM IR that rustc generates, not what's left after LLVM is done with it

nikomatsakis (Sep 20 2019 at 19:47, on Zulip):

ok, that's what I figured

nikomatsakis (Sep 20 2019 at 19:49, on Zulip):

We have a fork of LLVM, right? With patches?

nikomatsakis (Sep 20 2019 at 19:49, on Zulip):

Where is that located?

rkruppe (Sep 20 2019 at 19:50, on Zulip):

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

nikomatsakis (Sep 20 2019 at 19:51, on Zulip):

oh hey, I just found this chapter in the rustc-guide

nikomatsakis (Sep 20 2019 at 19:51, on Zulip):

nice!

nikomatsakis (Sep 20 2019 at 19:51, on Zulip):

this contains most everything I was writing

Last update: Nov 15 2019 at 10:40UTC