<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_llvm/src/back/write.rs, branch 1.74.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.74.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.74.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-09-25T17:31:58+00:00</updated>
<entry>
<title>Pass name of object file to LLVM so it can correctly emit S_OBJNAME</title>
<updated>2023-09-25T17:31:58+00:00</updated>
<author>
<name>Florian Schmiderer</name>
<email>florian.schmiderer@posteo.net</email>
</author>
<published>2023-09-09T12:00:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=91544e6a937b4c2c7181578533e6d10991559c14'/>
<id>urn:sha1:91544e6a937b4c2c7181578533e6d10991559c14</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add OwnedTargetMachine to manage llvm:TargetMachine. Uses pointers</title>
<updated>2023-09-24T19:11:37+00:00</updated>
<author>
<name>Florian Schmiderer</name>
<email>florian.schmiderer@posteo.net</email>
</author>
<published>2023-09-17T12:40:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3409ca65d835b858d9cefbe8949552f0f5ad0788'/>
<id>urn:sha1:3409ca65d835b858d9cefbe8949552f0f5ad0788</id>
<content type='text'>
instead of &amp;'static mut and provides safe interface to create/dispose
it.
</content>
</entry>
<entry>
<title>debuginfo: add compiler option to allow compressed debuginfo sections</title>
<updated>2023-09-08T14:45:29+00:00</updated>
<author>
<name>Augie Fackler</name>
<email>augie@google.com</email>
</author>
<published>2023-07-12T21:07:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=af9e55068c2e38b1f7afc7f7374a5a53c59b2001'/>
<id>urn:sha1:af9e55068c2e38b1f7afc7f7374a5a53c59b2001</id>
<content type='text'>
LLVM already supports emitting compressed debuginfo. In debuginfo=full
builds, the debug section is often a large amount of data, and it
typically compresses very well (3x is not unreasonable.) We add a new
knob to allow debuginfo to be compressed when the matching LLVM
functionality is present. Like clang, if a known-but-disabled
compression mechanism is requested, we disable compression and emit
uncompressed debuginfo sections.

The API is different enough on older LLVMs we just pretend the support
is missing on LLVM older than 16.
</content>
</entry>
<entry>
<title>lto: load bitcode sections by name</title>
<updated>2023-09-08T14:45:22+00:00</updated>
<author>
<name>Augie Fackler</name>
<email>augie@google.com</email>
</author>
<published>2023-09-07T13:48:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=942bdf910cc85e6389546e25cfb391062095cbd8'/>
<id>urn:sha1:942bdf910cc85e6389546e25cfb391062095cbd8</id>
<content type='text'>
Upstream change
llvm/llvm-project@6b539f5eb8ef1d3a3c87873caa2dbd5147e1adbd changed
`isSectionBitcode` works and it now only respects `.llvm.lto` sections
instead of also `.llvmbc`, which it says was never intended to be used
for LTO. We instead load sections by name, and sniff for raw bitcode by
hand.

r? @nikic
@rustbot label: +llvm-main
</content>
</entry>
<entry>
<title>Add missing Debuginfo to PDB debug file on windows.</title>
<updated>2023-09-07T22:28:40+00:00</updated>
<author>
<name>Florian Schmiderer</name>
<email>florian.schmiderer@posteo.net</email>
</author>
<published>2023-07-03T11:11:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4cdc633301e3c760fb36470afc216a9e09351fa3'/>
<id>urn:sha1:4cdc633301e3c760fb36470afc216a9e09351fa3</id>
<content type='text'>
Set Arg0 and CommandLineArgs in MCTargetoptions so LLVM outputs correct CL and CMD in LF_DEBUGINFO instead of empty/invalid values.
</content>
</entry>
<entry>
<title>Rollup merge of #113593 - rcvalle:rust-cfi-fix-90546, r=wesleywiser</title>
<updated>2023-08-08T19:44:43+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-08-08T19:44:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c097e48082e3453bf7670c79bb1b282a9e900e1d'/>
<id>urn:sha1:c097e48082e3453bf7670c79bb1b282a9e900e1d</id>
<content type='text'>
CFI: Fix error compiling core with LLVM CFI enabled

Fix #90546 by filtering out global value function pointer types from the type tests, and adding the LowerTypeTests pass to the rustc LTO optimization pipelines.
</content>
</entry>
<entry>
<title>Only enable hotness information when PGO is available</title>
<updated>2023-08-08T13:36:55+00:00</updated>
<author>
<name>Jakub Beránek</name>
<email>berykubik@gmail.com</email>
</author>
<published>2023-08-07T15:56:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9d417d7c86259498855fc50ba0e853edbb13320d'/>
<id>urn:sha1:9d417d7c86259498855fc50ba0e853edbb13320d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>CFI: Fix error compiling core with LLVM CFI enabled</title>
<updated>2023-08-07T22:59:15+00:00</updated>
<author>
<name>Ramon de C Valle</name>
<email>rcvalle@users.noreply.github.com</email>
</author>
<published>2023-07-11T23:19:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f837c48f0d8da1a205b7ab97846bc90f8d497271'/>
<id>urn:sha1:f837c48f0d8da1a205b7ab97846bc90f8d497271</id>
<content type='text'>
Fix #90546 by filtering out global value function pointer types from the
type tests, and adding the LowerTypeTests pass to the rustc LTO
optimization pipelines.
</content>
</entry>
<entry>
<title>Auto merge of #113339 - lqd:respect-filters, r=tmiasko</title>
<updated>2023-08-01T23:15:20+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-08-01T23:15:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f77c624c03065298ac76051a4c1c5c2cfeafc0e0'/>
<id>urn:sha1:f77c624c03065298ac76051a4c1c5c2cfeafc0e0</id>
<content type='text'>
Filter out short-lived LLVM diagnostics before they reach the rustc handler

During profiling I saw remark passes being unconditionally enabled: for example `Machine Optimization Remark Emitter`.

The diagnostic remarks enabled by default are [from missed optimizations and opt analyses](https://github.com/rust-lang/rust/pull/113339#discussion_r1259480303). They are created by LLVM, passed to the diagnostic handler on the C++ side, emitted to rust, where they are unpacked, C++ strings are converted to rust, etc.

Then they are discarded in the vast majority of the time (i.e. unless some kind of `-Cremark` has enabled some of these passes' output to be printed).

These unneeded allocations are very short-lived, basically only lasting between the LLVM pass emitting them and the rust handler where they are discarded. So it doesn't hugely impact max-rss, and is only a slight reduction in instruction count (cachegrind reports a reduction between 0.3% and 0.5%) _on linux_. It's possible that targets without `jemalloc` or with a worse allocator, may optimize these less.

It is however significant in the aggregate, looking at the total number of allocated bytes:
- it's the biggest source of allocations according to dhat, on the benchmarks I've tried e.g. `syn` or `cargo`
- allocations on `syn` are reduced by 440MB, 17% (from 2440722647 bytes total, to 2030461328 bytes)
- allocations on `cargo` are reduced by 6.6GB, 19% (from 35371886402 bytes total, to 28723987743 bytes)

Some of these diagnostics objects [are allocated in LLVM](https://github.com/rust-lang/rust/pull/113339#discussion_r1252387484) *before* they're emitted to our diagnostic handler, where they'll be filtered out. So we could remove those in the future, but that will require changing a few LLVM call-sites upstream, so I left a FIXME.
</content>
</entry>
<entry>
<title>remove remark filtering on the rust side</title>
<updated>2023-08-01T21:01:20+00:00</updated>
<author>
<name>Rémy Rakic</name>
<email>remy.rakic+github@gmail.com</email>
</author>
<published>2023-07-14T16:09:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ca5a383fb6b16679b31029ab5da8438b5ef03e1e'/>
<id>urn:sha1:ca5a383fb6b16679b31029ab5da8438b5ef03e1e</id>
<content type='text'>
now that remarks are filtered before cg_llvm's diagnostic handler callback
is called, we don't need to do the filtering post c++-to-rust conversion
of the diagnostic.
</content>
</entry>
</feed>
