summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back/lto.rs
AgeCommit message (Collapse)AuthorLines
2018-12-03codegen_llvm_back: improve allocationsljedrz-8/+10
2018-11-16[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.Eduard-Mihai Burtescu-1/+1
2018-11-16[eddyb] rustc_codegen_ssa: avoid a `Clone` bound on `TargetMachine`.Eduard-Mihai Burtescu-1/+1
2018-11-16Separating the back folder between backend-agnostic and LLVM-specific codeDenis Merigoux-260/+164
2018-11-16Beginning of moving all backend-agnostic code to rustc_codegen_ssaDenis Merigoux-1/+1
2018-11-16Moved Backend interface into rustc_codegen_utilsDenis Merigoux-1/+2
2018-11-16Generalized base:codegen_crateDenis Merigoux-8/+7
2018-11-16Removed phantomdata no longer necessaryDenis Merigoux-2/+0
Because CodegenContext doesn't implement Backend anymore
2018-11-16CommonWriteMethods are not static any moreDenis Merigoux-0/+2
2018-11-11Auto merge of #55698 - nikic:remove-llvm-4-support, r=alexcrichtonbors-3/+1
Remove support for building against LLVM 4 With emscripten removed in #55626, we no longer need to support building against LLVM 4.
2018-11-10codegen_llvm_back: improve common patternsljedrz-8/+2
2018-11-10codegen_llvm_back: use Cow<'static, str> where applicableljedrz-9/+9
2018-11-10codegen_llvm_back: whitespace & formatting fixesljedrz-9/+8
2018-11-06Run name-anon-globals after LTO passes as wellNikita Popov-0/+7
If we're going to emit bitcode (through ThinLTOBuffer), then we need to ensure that anon globals are named. This was already done after optimization passes, but also has to happen after LTO passes, as we always emit the final result in a ThinLTO-compatible manner. Fixes #51947.
2018-11-05Remove support for building against LLVM 4Nikita Popov-3/+1
With emscripten removed in #55626, we no longer need to support building against LLVM 4.
2018-11-03Move cg_llvm::back::linker to cg_utilsbjorn3-1/+1
2018-10-23Revert "rustc: Fix (again) simd vectors by-val in ABI"Alex Crichton-5/+7
This reverts commit 3cc8f738d4247a9b475d8e074b621e602ac2b7be.
2018-10-20Rollup merge of #55073 - alexcrichton:demote-simd, r=nagisaManish Goregaokar-7/+5
The issue of passing around SIMD types as values between functions has seen [quite a lot] of [discussion], and although we thought [we fixed it][quite a lot] it [wasn't]! This PR is a change to rustc to, again, try to fix this issue. The fundamental problem here remains the same, if a SIMD vector argument is passed by-value in LLVM's function type, then if the caller and callee disagree on target features a miscompile happens. We solve this by never passing SIMD vectors by-value, but LLVM will still thwart us with its argument promotion pass to promote by-ref SIMD arguments to by-val SIMD arguments. This commit is an attempt to thwart LLVM thwarting us. We, just before codegen, will take yet another look at the LLVM module and demote any by-value SIMD arguments we see. This is a very manual attempt by us to ensure the codegen for a module keeps working, and it unfortunately is likely producing suboptimal code, even in release mode. The saving grace for this, in theory, is that if SIMD types are passed by-value across a boundary in release mode it's pretty unlikely to be performance sensitive (as it's already doing a load/store, and otherwise perf-sensitive bits should be inlined). The implementation here is basically a big wad of C++. It was largely copied from LLVM's own argument promotion pass, only doing the reverse. In local testing this... Closes #50154 Closes #52636 Closes #54583 Closes #55059 [quite a lot]: https://github.com/rust-lang/rust/pull/47743 [discussion]: https://github.com/rust-lang/rust/issues/44367 [wasn't]: https://github.com/rust-lang/rust/issues/50154
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-11/+3
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-2/+2
2018-10-19rustc: Fix (again) simd vectors by-val in ABIAlex Crichton-7/+5
The issue of passing around SIMD types as values between functions has seen [quite a lot] of [discussion], and although we thought [we fixed it][quite a lot] it [wasn't]! This PR is a change to rustc to, again, try to fix this issue. The fundamental problem here remains the same, if a SIMD vector argument is passed by-value in LLVM's function type, then if the caller and callee disagree on target features a miscompile happens. We solve this by never passing SIMD vectors by-value, but LLVM will still thwart us with its argument promotion pass to promote by-ref SIMD arguments to by-val SIMD arguments. This commit is an attempt to thwart LLVM thwarting us. We, just before codegen, will take yet another look at the LLVM module and demote any by-value SIMD arguments we see. This is a very manual attempt by us to ensure the codegen for a module keeps working, and it unfortunately is likely producing suboptimal code, even in release mode. The saving grace for this, in theory, is that if SIMD types are passed by-value across a boundary in release mode it's pretty unlikely to be performance sensitive (as it's already doing a load/store, and otherwise perf-sensitive bits should be inlined). The implementation here is basically a big wad of C++. It was largely copied from LLVM's own argument promotion pass, only doing the reverse. In local testing this... Closes #50154 Closes #52636 Closes #54583 Closes #55059 [quite a lot]: https://github.com/rust-lang/rust/pull/47743 [discussion]: https://github.com/rust-lang/rust/issues/44367 [wasn't]: https://github.com/rust-lang/rust/issues/50154
2018-09-18incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to ↵Michael Woerister-0/+3
test incremental ThinLTO.
2018-09-14Rollup merge of #53950 - michaelwoerister:more-lto-cli, r=alexcrichtonkennytm-2/+1
Allow for opting out of ThinLTO and clean up LTO related cli flag handling. It turns out that there currently is no way to explicitly disable ThinLTO (except for the nightly-only `-Zthinlto` flag). This PR extends `-C lto` to take `yes` and `no` in addition to `thin` and `fat`. It should be backwards compatible. It also cleans up how LTO mode selection is handled. Note that merging the PR in the current state would make the new values for `-C lto` available on the stable channel. I think that would be fine but maybe some team should vote on it.
2018-09-05ThinLTO: Don't keep files open after mmaping them (because it's not needed).Michael Woerister-3/+3
2018-09-05Allow for opting out of ThinLTO and clean up LTO related cli flag handling.Michael Woerister-2/+1
2018-09-03incr.ThinLTO: Do some cleanup and add some logging.Michael Woerister-21/+33
2018-08-31Always add all modules to the global ThinLTO module analysis when compiling ↵Michael Woerister-138/+97
incrementally.
2018-08-31Support local ThinLTO with incremental compilation.Michael Woerister-20/+88
2018-08-31Persist ThinLTO import data in incr. comp. session directory.Michael Woerister-3/+116
2018-08-15Use CGU name as LLVM module name and add some caching to CGU name generation.Michael Woerister-6/+5
2018-08-07Fix issue around dllimport and ThinLTO as LLD runs it.Michael Woerister-0/+4
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-6/+6
This is a clippy-breaking change.
2018-07-31rustc: Handle linker diagnostic from LLVMAlex Crichton-2/+10
Previously linker diagnostic were being hidden when two modules were linked together but failed to link. This commit fixes the situation by ensuring that we have a diagnostic handler installed and also adds support for handling linker diagnostics.
2018-07-30rustc_codegen_llvm: use safe references for ThinLTOData.Irina Popa-7/+6
2018-07-30rustc_codegen_llvm: use safe references for ThinLTOBuffer.Irina Popa-2/+2
2018-07-30rustc_codegen_llvm: use safe references for ModuleBuffer.Irina Popa-2/+2
2018-07-30rustc_codegen_llvm: use safe references for Linker.Irina Popa-5/+5
2018-07-30rustc_codegen_llvm: use safe references for TargetMachine.Irina Popa-2/+2
2018-07-30rustc_codegen_llvm: use safe references for Pass.Irina Popa-4/+2
2018-07-30rustc_codegen_llvm: use safe references for Context and Module.Irina Popa-160/+166
2018-07-28Don't format!() string literalsljedrz-7/+7
2018-07-18rustc: Remove a workaroudn in ThinLTO fixed upstreamAlex Crichton-14/+0
This commit removes a hack in our ThinLTO passes which removes available externally functions manually. The [upstream bug][1] has long since been fixed, so we should be able to rely on LLVM natively for this now! [1]: https://bugs.llvm.org/show_bug.cgi?id=35736
2018-07-16Revert "Provide a way of accessing the ThinLTO module import map in rustc."Michael Woerister-68/+1
This reverts commit 9df56ca0eea1a8f5af945df25ce23e276b1d48a7.
2018-07-16Revert "Persist ThinLTO import data in incr. comp. session directory."Michael Woerister-81/+2
This reverts commit 8dc7ddb9763f28b83de7bf3b3025f8042ea9e830.
2018-07-16Revert "Clean up LLVM module naming (just use CodegenUnit names)."Michael Woerister-5/+6
This reverts commit f6894ebe664d111259a91a2b5fcc1236ca413436.
2018-07-16Revert "Use callback-based interface to load ThinLTO import data into rustc."Michael Woerister-31/+43
This reverts commit e045a6cd8c0235a26ef11e6cd9a13ebd817f1265.
2018-07-13Use callback-based interface to load ThinLTO import data into rustc.Michael Woerister-43/+31
2018-07-11Clean up LLVM module naming (just use CodegenUnit names).Michael Woerister-6/+5
2018-07-11Persist ThinLTO import data in incr. comp. session directory.Michael Woerister-2/+81
2018-07-11Provide a way of accessing the ThinLTO module import map in rustc.Michael Woerister-1/+68