<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_llvm/src/back/write.rs, branch 1.58.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.58.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.58.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-01-05T20:21:05+00:00</updated>
<entry>
<title>Disable LLVM newPM by default</title>
<updated>2022-01-05T20:21:05+00:00</updated>
<author>
<name>Simonas Kazlauskas</name>
<email>git@kazlauskas.me</email>
</author>
<published>2021-11-24T19:13:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ce3d508f507949b2eec552237b540c129be3bc98'/>
<id>urn:sha1:ce3d508f507949b2eec552237b540c129be3bc98</id>
<content type='text'>
cc #91128
</content>
</entry>
<entry>
<title>Rollup merge of #90701 - michaelwoerister:more-artifact-sizes, r=davidtwco</title>
<updated>2021-11-09T18:00:45+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2021-11-09T18:00:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fd5a4f42ad425a19c022fcafe482341e2612f29e'/>
<id>urn:sha1:fd5a4f42ad425a19c022fcafe482341e2612f29e</id>
<content type='text'>
Record more artifact sizes during self-profiling.

This PR adds artifact size recording for

- "linked artifacts" (executables, RLIBs, dylibs, static libs)
- object files
- dwo files
- assembly files
- crate metadata
- LLVM bitcode files
- LLVM IR files
- codegen unit size estimates

Currently the identifiers emitted for these are hard-coded as string literals. Is it worth adding constants to https://github.com/rust-lang/measureme/blob/master/measureme/src/rustc.rs instead? We don't do that for query names and the like -- but artifact kinds might be more stable than query names.
</content>
</entry>
<entry>
<title>Record more artifact sizes during self-profiling.</title>
<updated>2021-11-08T16:02:40+00:00</updated>
<author>
<name>Michael Woerister</name>
<email>michaelwoerister@posteo</email>
</author>
<published>2021-11-08T15:59:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fefe1e9192696c07f1655ed2726c4e114b70b096'/>
<id>urn:sha1:fefe1e9192696c07f1655ed2726c4e114b70b096</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't abort compilation after giving a lint error</title>
<updated>2021-11-08T01:22:28+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2021-07-21T03:23:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0ac13bd430cdd433a1b7f5a821fdd538737ae34e'/>
<id>urn:sha1:0ac13bd430cdd433a1b7f5a821fdd538737ae34e</id>
<content type='text'>
The only reason to use `abort_if_errors` is when the program is so broken that either:
1. later passes get confused and ICE
2. any diagnostics from later passes would be noise

This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints.
So it can continue to lint and compile even if there are lint errors.
</content>
</entry>
<entry>
<title>Rollup merge of #89581 - jblazquez:master, r=Mark-Simulacrum</title>
<updated>2021-10-25T20:59:46+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2021-10-25T20:59:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2f6764760665a2ac776293edf8b6772d17f3e266'/>
<id>urn:sha1:2f6764760665a2ac776293edf8b6772d17f3e266</id>
<content type='text'>
Add -Z no-unique-section-names to reduce ELF header bloat.

This change adds a new compiler flag that can help reduce the size of ELF binaries that contain many functions.

By default, when enabling function sections (which is the default for most targets), the LLVM backend will generate different section names for each function. For example, a function `func` would generate a section called `.text.func`. Normally this is fine because the linker will merge all those sections into a single one in the binary. However, starting with [LLVM 12](https://github.com/llvm/llvm-project/commit/ee5d1a04), the backend will also generate unique section names for exception handling, resulting in thousands of `.gcc_except_table.*` sections ending up in the final binary because some linkers like LLD don't currently merge or strip these EH sections (see discussion [here](https://reviews.llvm.org/D83655)). This can bloat the ELF headers and string table significantly in binaries that contain many functions.

The new option is analogous to Clang's `-fno-unique-section-names`, and instructs LLVM to generate the same `.text` and `.gcc_except_table` section for each function, resulting in a smaller final binary.

The motivation to add this new option was because we have a binary that ended up with so many ELF sections (over 65,000) that it broke some existing ELF tools, which couldn't handle so many sections.

Here's our old binary:

```
$ readelf --sections old.elf | head -1
There are 71746 section headers, starting at offset 0x2a246508:

$ readelf --sections old.elf | grep shstrtab
  [71742] .shstrtab      STRTAB          0000000000000000 2977204c ad44bb 00      0   0  1
```

That's an 11MB+ string table. Here's the new binary using this option:

```
$ readelf --sections new.elf | head -1
There are 43 section headers, starting at offset 0x29143ca8:

$ readelf --sections new.elf | grep shstrtab
  [40] .shstrtab         STRTAB          0000000000000000 29143acc 0001db 00      0   0  1
```

The whole binary size went down by over 20MB, which is quite significant.
</content>
</entry>
<entry>
<title>Add -Z no-unique-section-names to reduce ELF header bloat.</title>
<updated>2021-10-11T19:09:32+00:00</updated>
<author>
<name>Javier Blazquez</name>
<email>jblazquez@riotgames.com</email>
</author>
<published>2021-10-11T19:09:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4ed846ad4d4e0be96efc4837fa416aabce1882db'/>
<id>urn:sha1:4ed846ad4d4e0be96efc4837fa416aabce1882db</id>
<content type='text'>
This change adds a new compiler flag that can help reduce the size of
ELF binaries that contain many functions.

By default, when enabling function sections (which is the default for most
targets), the LLVM backend will generate different section names for each
function. For example, a function "func" would generate a section called
".text.func". Normally this is fine because the linker will merge all those
sections into a single one in the binary. However, starting with LLVM 12
(llvm/llvm-project@ee5d1a0), the backend will
also generate unique section names for exception handling, resulting in
thousands of ".gcc_except_table.*" sections ending up in the final binary
because some linkers don't currently merge or strip these EH sections.
This can bloat the ELF headers and string table significantly in
binaries that contain many functions.

The new option is analogous to Clang's -fno-unique-section-names, and
instructs LLVM to generate the same ".text" and ".gcc_except_table"
section for each function, resulting in smaller object files and
potentially a smaller final binary.
</content>
</entry>
<entry>
<title>Default to disabling the new pass manager for the s390x targets.</title>
<updated>2021-10-08T13:05:07+00:00</updated>
<author>
<name>Hans Kratz</name>
<email>hans@appfour.com</email>
</author>
<published>2021-10-08T10:10:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4593d78e96253ccf8440605f8db49c09ece48b8c'/>
<id>urn:sha1:4593d78e96253ccf8440605f8db49c09ece48b8c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Enable AutoFDO.</title>
<updated>2021-10-06T19:36:52+00:00</updated>
<author>
<name>Michael Benfield</name>
<email>mbenfield@google.com</email>
</author>
<published>2021-05-07T07:41:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a17193dbb931ea0c8b66d82f640385bce8b4929a'/>
<id>urn:sha1:a17193dbb931ea0c8b66d82f640385bce8b4929a</id>
<content type='text'>
This largely involves implementing the options debug-info-for-profiling
and profile-sample-use and forwarding them on to LLVM.

AutoFDO can be used on x86-64 Linux like this:
rustc -O -Cdebug-info-for-profiling main.rs -o main
perf record -b ./main
create_llvm_prof --binary=main --out=code.prof
rustc -O -Cprofile-sample-use=code.prof main.rs -o main2

Now `main2` will have feedback directed optimization applied to it.

The create_llvm_prof tool can be obtained from this github repository:
https://github.com/google/autofdo

Fixes #64892.
</content>
</entry>
<entry>
<title>Auto merge of #89405 - GuillaumeGomez:fix-clippy-lints, r=cjgillot</title>
<updated>2021-10-02T10:52:09+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2021-10-02T10:52:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b27661eb33c74cb514dba059b47d86b6582ac1c2'/>
<id>urn:sha1:b27661eb33c74cb514dba059b47d86b6582ac1c2</id>
<content type='text'>
Fix clippy lints

I'm currently working on allowing clippy to run on librustdoc after a discussion I had with `@Mark-Simulacrum.` So in the meantime, I fixed a few lints on the compiler crates.
</content>
</entry>
<entry>
<title>Rollup merge of #89376 - andjo403:selfProfileUseAfterDropFix, r=Mark-Simulacrum</title>
<updated>2021-10-01T21:46:49+00:00</updated>
<author>
<name>Manish Goregaokar</name>
<email>manishsmail@gmail.com</email>
</author>
<published>2021-10-01T21:46:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1781e4b81af0440ce58b6905724df5d3e2afd548'/>
<id>urn:sha1:1781e4b81af0440ce58b6905724df5d3e2afd548</id>
<content type='text'>
Fix use after drop in self-profile with llvm events

self-profile with `-Z self-profile-events=llvm` have failed with a segmentation fault due to this use after drop.
this type of events can be more useful now that the new passmanager is the default.
</content>
</entry>
</feed>
