about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back
AgeCommit message (Collapse)AuthorLines
2018-09-14Rollup merge of #53950 - michaelwoerister:more-lto-cli, r=alexcrichtonkennytm-8/+4
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-4/+4
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-4/+4
2018-09-05Allow for opting out of ThinLTO and clean up LTO related cli flag handling.Michael Woerister-8/+4
2018-09-03incr.ThinLTO: Do some cleanup and add some logging.Michael Woerister-62/+57
2018-08-31rustc: Prepare the `atomics` feature for wasmAlex Crichton-4/+13
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-08-31Always add all modules to the global ThinLTO module analysis when compiling ↵Michael Woerister-264/+125
incrementally.
2018-08-31Support local ThinLTO with incremental compilation.Michael Woerister-176/+473
2018-08-31Persist ThinLTO import data in incr. comp. session directory.Michael Woerister-3/+116
2018-08-30Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelixPietro Albini-4/+4
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc. Most of the compiler uses the `Fx` hasher but some places ended up with the default one.
2018-08-28Fix warnings about the `native` target-cpuAlex Crichton-2/+4
This fixes a regression from #53031 where specifying `-C target-cpu=native` is printing a lot of warnings from LLVM about `native` being an unknown CPU. It turns out that `native` is indeed an unknown CPU and we have to perform a mapping to an actual CPU name, but this mapping is only performed in one location rather than all locations we inform LLVM about the target CPU. This commit centralizes the mapping of `native` to LLVM's value of the native CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's never `native`. Closes #53322
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-4/+4
2018-08-27Rename hir::map::NodeKind to hir::Nodevarkor-5/+5
2018-08-27Remove path prefixes from NodeKindvarkor-4/+5
2018-08-27Rename hir::map::Node to hir::map::NodeKindvarkor-4/+4
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-2/+2
Fix typos found by codespell.
2018-08-21Rollup merge of #53465 - bjorn3:remove_link_meta_struct, r=varkorkennytm-7/+7
Remove LinkMeta struct Fixes #53291
2018-08-20Auto merge of #52101 - japaric:linker-flavor, r=alexcrichtonbors-36/+88
try to infer linker flavor from linker name and vice versa This is a second take on PR #50359 that implements the logic proposed in https://github.com/rust-lang/rust/pull/50359#pullrequestreview-116663121 With this change it would become possible to link `thumb*` binaries using GNU's LD on stable as `-C linker=arm-none-eabi-ld` would be enough to change both the linker and the linker flavor from their default values of `arm-none-eabi-gcc` and `gcc`. To link `thumb*` binaries using rustc's LLD on stable `-Z linker-flavor` would need to be stabilized as `-C linker=rust-lld -Z linker-flavor=ld.lld` are both required to change the linker and the linker flavor, but this PR doesn't propose that. We would probably need some sort of stability guarantee around `rust-lld`'s name and availability to make linking with rustc's LLD truly stable. With this change it would also be possible to link `thumb*` binaries using a system installed LLD on stable using the `-C linker=ld.lld` flag (provided that `ld.lld` is a symlink to the system installed LLD). r? @alexcrichton
2018-08-19fix: preserve msvc linker fallback logicJorge Aparicio-1/+3
2018-08-19Fix typos found by codespell.Matthias Krüger-2/+2
2018-08-19fix: use detected MSVC's link.exeJorge Aparicio-2/+5
2018-08-19LinkerFlavor::Gcc defaults to cc, not gccJorge Aparicio-1/+1
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-3/+2
2018-08-18fatal -> bugJorge Aparicio-1/+1
2018-08-18add lld_flavor info to target specJorge Aparicio-0/+2
this field defaults to the LD / GNU flavor
2018-08-18Remove LinkMeta structbjorn3-7/+7
2018-08-17Auto merge of #53356 - michaelwoerister:itlto, r=alexcrichtonbors-15/+6
Preliminary work for incremental ThinLTO (CGU name edition) Bring back the first half of #52266 but hopefully without the performance regression.
2018-08-16wasm: Remove --strip-debug argument to LLDAlex Crichton-12/+0
Originally added in #52887 this commit disables passing `--strip-debug` to LLD when optimized. This bring back the original bug of emitting broken debuginfo but currently it *also* strips the `name` section which makes it very difficult to inspect the final binary. A real fix is happening at https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to have that commit.
2018-08-15Auto merge of #53237 - overdrivenpotato:wasm-export-table, r=alexcrichtonbors-0/+3
Export WASM table by default This allows loading a rust-generated `.wasm` binary in a host and using the exported table much like the `memory` export.
2018-08-15Use CGU name as LLVM module name and add some caching to CGU name generation.Michael Woerister-15/+6
2018-08-14Rollup merge of #53290 - whitequark:fix-35741, r=nagisakennytm-0/+3
Make LLVM emit assembly comments with -Z asm-comments Fixes #35741, and makes `-Z asm-comments` actually do something useful. Before: ``` .section .text.main,"ax",@progbits .globl main .p2align 4, 0x90 .type main,@function main: .cfi_startproc pushq %rax .cfi_def_cfa_offset 16 movslq %edi, %rax leaq _ZN1t4main17he95a7d4f1843730eE(%rip), %rdi movq %rsi, (%rsp) movq %rax, %rsi movq (%rsp), %rdx callq _ZN3std2rt10lang_start17h3121da83b2bc3697E movl %eax, %ecx movl %ecx, %eax popq %rcx .cfi_def_cfa_offset 8 retq .Lfunc_end8: .size main, .Lfunc_end8-main .cfi_endproc ``` After: ``` .section .text.main,"ax",@progbits .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: pushq %rax .cfi_def_cfa_offset 16 movslq %edi, %rax leaq _ZN1t4main17he95a7d4f1843730eE(%rip), %rdi movq %rsi, (%rsp) # 8-byte Spill movq %rax, %rsi movq (%rsp), %rdx # 8-byte Reload callq _ZN3std2rt10lang_start17h3121da83b2bc3697E movl %eax, %ecx movl %ecx, %eax popq %rcx .cfi_def_cfa_offset 8 retq .Lfunc_end8: .size main, .Lfunc_end8-main .cfi_endproc # -- End function ```
2018-08-12Make LLVM emit assembly comments with -Z asm-comments.whitequark-0/+3
Fixes #35741.
2018-08-10Introduce SmallCStr and use it where applicable.Michael Woerister-6/+4
2018-08-09address review commentsJorge Aparicio-60/+43
2018-08-09try to infer linker flavor from linker name and vice versaJorge Aparicio-34/+96
2018-08-09Export WASM table by defaultMarko Mijalkovic-0/+3
2018-08-09Move Fingerprint to data structuresMark Rousskov-1/+1
2018-08-09Move path2cstr to rustc_fs_utilMark Rousskov-2/+1
2018-08-09Move rustc::util::fs into separate (new) crateMark Rousskov-2/+2
2018-08-08Address review comments for #53031 and fix some merge fallout.Michael Woerister-6/+6
2018-08-07Set 'PrepareForThinLTO' whenever doing cross-language LTO.Michael Woerister-1/+2
2018-08-07Make sure upstream object files are added to staticlibs when compilingMichael Woerister-1/+5
with ThinLTO and cross-lang-lto. Normally, when compiling with whole-crate-graph ThinLTO, we expect rustc's LTO step to "uplift" upstream object files/LLVM modules to the current set of compilation artifacts. Therefore the staticlib creation code skips this uplifting. However, when compiling with "cross-language LTO" (i.e. defer LTO to the actual linker), the LTO step in rustc is not performed, so we have to take care of copying upstream object files during archive creation (like we already do when compiling without any LTO).
2018-08-07Fix issue around dllimport and ThinLTO as LLD runs it.Michael Woerister-6/+22
2018-08-07Auto merge of #51007 - AstralSorcerer:master, r=nagisabors-0/+31
Make globals with private linkage unnamed. Fixes #50862. cc @oli-obk @nagisa
2018-08-04Move share_generics getter onto options directlyMark Rousskov-1/+1
2018-08-04Normalize DebugInfoLevel to standard styleMark Rousskov-9/+9
2018-08-04Normalize variants of Passes to standard styleMark Rousskov-4/+3
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-38/+38
This is a clippy-breaking change.
2018-08-03Auto merge of #52887 - yurydelendik:disable-lld-symbols, r=alexcrichtonbors-0/+12
Disable debug sections when optimization flags is set for LLD. Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901) Using `--strip-debug` along with the `-O` option.