<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp, branch 1.75.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.75.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.75.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-10-06T12:04:28+00:00</updated>
<entry>
<title>fix to register analysis pass from llvm plugin</title>
<updated>2023-10-06T12:04:28+00:00</updated>
<author>
<name>Emanuele Vannacci</name>
<email>emanuele.vannacci@gmail.com</email>
</author>
<published>2023-10-06T12:04:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5048f813130f5c50fb95b784ad14ff40477c500b'/>
<id>urn:sha1:5048f813130f5c50fb95b784ad14ff40477c500b</id>
<content type='text'>
</content>
</entry>
<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>llvm-wrapper: adapt for LLVM API changes</title>
<updated>2023-09-15T14:31:43+00:00</updated>
<author>
<name>Krasimir Georgiev</name>
<email>krasimir@google.com</email>
</author>
<published>2023-09-15T14:31:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=af401b0ca366edd7d0df061b7a635c06e6481f18'/>
<id>urn:sha1:af401b0ca366edd7d0df061b7a635c06e6481f18</id>
<content type='text'>
No functional changes intended.

Adapts the wrapper for https://github.com/llvm/llvm-project/commit/0a1aa6cda2758b0926a95f87d39ffefb1cb90200.

Found by our experimental rust + llvm @ head CI: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/22301#018a9926-a810-4e56-8ac2-e6f30b78f433/253-551
</content>
</entry>
<entry>
<title>Rollup merge of #115358 - durin42:compress-debuginfo, r=oli-obk</title>
<updated>2023-09-08T22:28:19+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-09-08T22:28:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=aa78b4c36806c1e020607989c6ae9a48cff1b9b1'/>
<id>urn:sha1:aa78b4c36806c1e020607989c6ae9a48cff1b9b1</id>
<content type='text'>
debuginfo: add compiler option to allow compressed debuginfo sections

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>Auto merge of #115641 - durin42:llvm-18-fatlto-take-2, r=nikic</title>
<updated>2023-09-08T19:07:17+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-09-08T19:07:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ffc48e3eda36e288f76b4022d72d94321887ebf5'/>
<id>urn:sha1:ffc48e3eda36e288f76b4022d72d94321887ebf5</id>
<content type='text'>
lto: load bitcode sections by name

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.

This is an alternative approach to #115136, where we tried the same thing using the `object` crate, but it got too fraught to continue.

r? `@nikic`
`@rustbot` label: +llvm-main
</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>Rollup merge of #115638 - ldm0:ldm/llvm-args-fix, r=nikic</title>
<updated>2023-09-08T12:10:52+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2023-09-08T12:10:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=575c3633f8bd4694d62ba47305f2b8818f5f7a9c'/>
<id>urn:sha1:575c3633f8bd4694d62ba47305f2b8818f5f7a9c</id>
<content type='text'>
`-Cllvm-args` usability improvement

fixes: #26338
fixes: #115564

Two problems were found during playing with `-Cllvm-args`

1. When `llvm.link-shared` is set to `false` in `config.toml`, output of `rustc -C llvm-args='--help-list-hidden'` doesn't contain `--emit-dwarf-unwind` and `--emulated-tls`. When it is set to `true`, `rustc -C llvm-args='--help-list-hidden'` emits `--emit-dwarf-unwind`, but `--emulated-tls` is still missing.
2. Setting `-Cllvm-args=--emit-dwarf-unwind=always` doesn't take any effect, but `-Cllvm-args=-machine-outliner-reruns=3` does work.

### 1

Adding `RegisterCodeGenFlags` to register codegen flags fixed the first problem. `rustc -C llvm-args='--help-list-hidden'` emits full codegen flags including `--emit-dwarf-unwind` and `--emulated-tls`.

### 2

Constructing `TargetOptions` from `InitTargetOptionsFromCodeGenFlags` in `LLVMRustCreateTargetMachine` fixed the second problem. The `LLVMRustSetLLVMOptions` calls `ParseCommandLineOptions` which parses given `llvm-args`. For options like `machine-outliner-reruns`, it just works, since the codegen logic directly consumes the parsing result:

[machine-outliner-reruns register](https://github.com/rust-lang/llvm-project/blob/0537f6354cffe546cbf47f6dc9c7f82e49e86cfb/llvm/lib/CodeGen/MachineOutliner.cpp#L114)
[machine-outliner-reruns consumption](https://github.com/rust-lang/llvm-project/blob/0537f6354cffe546cbf47f6dc9c7f82e49e86cfb/llvm/lib/CodeGen/MachineOutliner.cpp#L1138)

But for flags defined in `TargetOptions` and `MCTargetOptions` to take effect, constructing them with `InitTargetOptionsFromCodeGenFlags` is essential, or the parsing result is just not consumed. Similar patterns can be observed in [lli](https://github.com/rust-lang/llvm-project/blob/0537f6354cffe546cbf47f6dc9c7f82e49e86cfb/llvm/tools/llc/llc.cpp#L494), [llc](https://github.com/rust-lang/llvm-project/blob/0537f6354cffe546cbf47f6dc9c7f82e49e86cfb/llvm/tools/lli/lli.cpp#L517), etc.
</content>
</entry>
<entry>
<title>Auto merge of #113492 - nebulark:pr_96475, r=petrochenkov</title>
<updated>2023-09-08T10:06:40+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-09-08T10:06:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9be4eac2647432aa863f65da8a116f2eafd90ee9'/>
<id>urn:sha1:9be4eac2647432aa863f65da8a116f2eafd90ee9</id>
<content type='text'>
Add CL and CMD into to pdb debug info

Partial fix for https://github.com/rust-lang/rust/issues/96475

The Arg0 and CommandLineArgs of the MCTargetOptions cpp class are not set within https://github.com/rust-lang/rust/blob/bb548f964572f7fe652716f5897d9050a31c936e/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L378

This causes LLVM to not  neither output any compiler path (cl) nor the arguments that were used when invoking it (cmd) in the PDB file.

This fix adds the missing information to the target machine so LLVM can use it.
</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>
</feed>
