summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back/write.rs
AgeCommit message (Collapse)AuthorLines
2019-02-25librustc_codegen_llvm: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-1/+1
2019-02-18librustc_codegen_llvm => 2018Taiki Endo-15/+14
2019-02-12Stabilize linker-plugin based LTO.Michael Woerister-1/+1
2019-01-24Implement optimize(size) and optimize(speed)Simonas Kazlauskas-22/+29
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-03Auto merge of #56358 - nikic:mergefunc-aliases, r=rkruppebors-4/+5
Enable -mergefunc-use-aliases If the Rust LLVM fork is used, enable the -mergefunc-use-aliases flag, which will create aliases for merged functions, rather than inserting a call from one to the other. A number of codegen tests needed to be adjusted, because functions that previously fell below the thunk limit are now being merged. Merging is prevented in various ways now. I expect that this is going to break something, somewhere, because it isn't able to deal with aliases properly, but we won't find out until we try :) This fixes #52651. r? @rkruppe
2018-12-02Run name-anon-globals after all other passesNikita Popov-4/+5
name-anon-globals should always be run at the very end of the pass pipeline, as optimization passes (in particular mergefunc) may introduce new anonymous globals. I believe we did not run into this earlier because it requires the rather specific combination of a) mergefunc merging two weak functions b) compilation not using thinlto.
2018-11-29Rename conversion util; remove duplicate util in librustc_codegen_llvm.Corey Farwell-5/+5
2018-11-16[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.Eduard-Mihai Burtescu-1/+1
2018-11-16Separating the back folder between backend-agnostic and LLVM-specific codeDenis Merigoux-1827/+43
2018-11-16Finished moving backend-agnostic code to rustc_codegen_ssaDenis Merigoux-2/+1
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-2/+2
2018-11-16Generalized base:codegen_crateDenis Merigoux-11/+11
2018-11-16Removed phantomdata no longer necessaryDenis Merigoux-11/+6
Because CodegenContext doesn't implement Backend anymore
2018-11-16Removing LLVM content from CommonMethods -> ConstMethodsDenis Merigoux-24/+5
2018-11-16Prefixed type methods & removed trait impl for write::CodegenContextDenis Merigoux-22/+3
2018-11-16Prefixed const methods with "const" instead of "c"Denis Merigoux-6/+6
2018-11-16Traitification of type_ methodsDenis Merigoux-1/+9
The methods are now attached to CodegenCx instead of Type
2018-11-16Added definition of type traitDenis Merigoux-0/+1
2018-11-16Removed code duplication for CommonWriteMethodsDenis Merigoux-13/+5
2018-11-16CommonWriteMethods are not static any moreDenis Merigoux-12/+54
2018-11-16Split CommonMethods to accomodate for use in back/write.rsDenis Merigoux-1/+1
2018-11-16Traitification of common.rs methodsDenis Merigoux-6/+6
2018-11-16Removed genericity over Value in various functionsDenis Merigoux-2/+1
Prelude to using associated types in traits rather than type parameters
2018-11-16Generalized base.rs#call_memcpy and everything that it usesDenis Merigoux-1/+2
Generalized operand.rs#nontemporal_store and fixed tidy issues Generalized operand.rs#nontemporal_store's implem even more With a BuilderMethod trait implemented by Builder for LLVM Cleaned builder.rs : no more code duplication, no more ValueTrait Full traitification of builder.rs
2018-11-10codegen_llvm_back: remove 'static from constsljedrz-2/+2
2018-11-10codegen_llvm_back: use to_owned instead of to_string with string literalsljedrz-1/+1
2018-11-10codegen_llvm_back: improve common patternsljedrz-9/+6
2018-11-10codegen_llvm_back: use Cow<'static, str> where applicableljedrz-3/+3
2018-11-10codegen_llvm_back: whitespace & formatting fixesljedrz-30/+27
2018-11-06Run name-anon-globals after LTO passes as wellNikita Popov-2/+6
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-05Auto merge of #55593 - nikic:remove-llvm-4-checks, r=rkruppebors-17/+6
Remove checks for LLVM < 4.0 While we still have to support LLVM 4.0 for Emscripten, we can drop checks for LLVM >= 4.0 and < 4.0.
2018-11-03Move cg_llvm::back::linker to cg_utilsbjorn3-3/+3
2018-11-02rustc: Wait for all codegen threads to exitAlex Crichton-6/+51
This commit updates rustc to wait for all codegen threads to exit before allowing the main thread to exit. This is a stab in the dark to fix the mysterious segfaults appearing on #55238, and hopefully we'll see whether this actually fixes things in practice...
2018-11-01Remove checks for LLVM < 4.0Nikita Popov-17/+6
While we still have to support LLVM 4.0 for Emscripten, we can drop checks for LLVM >= 4.0 and < 4.0.
2018-10-23Revert "rustc: Fix (again) simd vectors by-val in ABI"Alex Crichton-33/+1
This reverts commit 3cc8f738d4247a9b475d8e074b621e602ac2b7be.
2018-10-20Rollup merge of #55073 - alexcrichton:demote-simd, r=nagisaManish Goregaokar-1/+33
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-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-10-19rustc: Fix (again) simd vectors by-val in ABIAlex Crichton-1/+33
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-12raise ICE if LLVM worker threads panicAndy Russell-4/+2
2018-09-26add -Z emit-stack-sizesJorge Aparicio-0/+2
2018-09-18incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to ↵Michael Woerister-0/+6
test incremental ThinLTO.
2018-09-14Rollup merge of #53950 - michaelwoerister:more-lto-cli, r=alexcrichtonkennytm-3/+2
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-05Auto merge of #53962 - michaelwoerister:close-thinlto-file-descriptors, ↵bors-1/+1
r=alexcrichton ThinLTO: Don't keep files open after mmaping them. Fixes #53947. r? @alexcrichton
2018-09-05Auto merge of #53878 - alexcrichton:wasm-atomics-feature, r=eddybbors-4/+13
rustc: Prepare the `atomics` feature for wasm This commit adds a few changes for atomic instructions on the `wasm32-unknown-unknown` target. Atomic instructions are not yet stable in WebAssembly itself but there are multiple implementations and LLVM has support for the proposed instruction set, so let's work on exposing it! Here there are a few inclusions: * The `atomics` feature was whitelisted for LLVM, allowing code in Rust to enable/disable/gate on this. * The `singlethread` option is turned off for wasm when the `atomics` feature is enabled. This means that by default wasm won't be lowering with atomics, but when atomics are enabled globally we'll turn off single-threaded mode to actually codegen atomics. This probably isn't what we'll want in the long term but for now it should work. * Finally the maximum atomic width is increased to 64 to reflect the current wasm spec.
2018-09-05ThinLTO: Don't keep files open after mmaping them (because it's not needed).Michael Woerister-1/+1
2018-09-05Allow for opting out of ThinLTO and clean up LTO related cli flag handling.Michael Woerister-3/+2
2018-09-03incr.ThinLTO: Do some cleanup and add some logging.Michael Woerister-41/+24