about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2018-07-16BinOpKindcsmoe-25/+25
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-105/+4
This reverts commit 8dc7ddb9763f28b83de7bf3b3025f8042ea9e830.
2018-07-16Revert "Clean up LLVM module naming (just use CodegenUnit names)."Michael Woerister-39/+69
This reverts commit f6894ebe664d111259a91a2b5fcc1236ca413436.
2018-07-16Revert "Use callback-based interface to load ThinLTO import data into rustc."Michael Woerister-32/+44
This reverts commit e045a6cd8c0235a26ef11e6cd9a13ebd817f1265.
2018-07-15Auto merge of #52381 - oli-obk:ty_to_def_id, r=eddybbors-11/+9
Remove `ty_to_def_id` fixes https://github.com/rust-lang/rust/issues/52341 The uses were mostly convenience and generally "too powerful" (would also have worked for types that weren't interesting at the use site) r? @eddyb
2018-07-15Ubsan this newly discovered dead codeOliver Schneider-14/+9
2018-07-14Add unaligned volatile intrinsicsAmanieu d'Antras-3/+23
2018-07-14Expose a self-referential objectOliver Schneider-0/+3
2018-07-14Auto merge of #52032 - DiamondLovesYou:amdgpu-kernel-abi, r=alexcrichtonbors-0/+2
Add the `amdgpu-kernel` ABI. Technically, there are requirements imposed by the LLVM `AMDGPUTargetMachine` on functions with this ABI (eg, the return type must be void), but I'm unsure exactly where this should be enforced.
2018-07-13Add the `amdgpu-kernel` ABI.Richard Diamond-0/+2
Technically, there are requirements imposed by the LLVM `AMDGPUTargetMachine` on functions with this ABI (eg, the return type must be void), but I'm unsure exactly where this should be enforced.
2018-07-13Auto merge of #52266 - michaelwoerister:incr-thinlto-preliminaries, ↵bors-74/+200
r=alexcrichton Preliminary work for incremental ThinLTO. Since implementing incremental ThinLTO is a bit more involved than I initially thought, I'm splitting out some of the things that already work. This PR (1) adds a way accessing some ThinLTO information in `rustc` and (2) does some cleanup around CGU/object file naming (which makes things quite a bit nicer). This is probably best reviewed one commit at a time.
2018-07-13Auto merge of #51987 - nikomatsakis:nll-region-infer-scc, r=pnkfelixbors-1/+1
nll experiment: compute SCCs instead of iterative region solving This is an attempt to speed up region solving by replacing the current iterative dataflow with a SCC computation. The idea is to detect cycles (SCCs) amongst region constraints and then compute just one value per cycle. The graph with all cycles removed is of course a DAG, so we can then solve constraints "bottom up" once the liveness values are known. I kinda ran out of time this morning so the last commit is a bit sloppy but I wanted to get this posted, let travis run on it, and maybe do a perf run, before I clean it up.
2018-07-13Use callback-based interface to load ThinLTO import data into rustc.Michael Woerister-44/+32
2018-07-12rename `control_flow_graph` to `graph`Niko Matsakis-1/+1
2018-07-12Auto merge of #52089 - eddyb:issue-51907, r=nagisabors-37/+43
rustc_codegen_llvm: replace the first argument early in FnType::new_vtable. Fixes #51907 by removing the vtable pointer before the `ArgType` is even created. This allows any ABI to support trait object method calls, regardless of how it passes `*dyn Trait`. r? @nikomatsakis
2018-07-11Clean up LLVM module naming (just use CodegenUnit names).Michael Woerister-69/+39
2018-07-11Rollup merge of #52252 - ljedrz:dyn_librustc_codegen_llvm, r=varkorMark Rousskov-33/+34
Deny bare trait objects in in src/librustc_codegen_llvm Enforce `#![deny(bare_trait_objects)]` in `src/librustc_codegen_llvm`.
2018-07-11Persist ThinLTO import data in incr. comp. session directory.Michael Woerister-4/+105
2018-07-11Provide a way of accessing the ThinLTO module import map in rustc.Michael Woerister-1/+68
2018-07-11Auto merge of #51230 - nikic:no-verify-lto, r=pnkfelixbors-10/+15
Disable LLVM verification by default Currently -Z no-verify only controls IR verification prior to LLVM codegen, while verification is performed unconditionally both before and after linking with (Thin)LTO. Also wondering what the sentiment is on disabling verification by default (and e.g. only enabling it on ALT builds with assertions). This does not seem terribly useful outside of rustc development and it does seem to show up in profiles (at something like 3%). **EDIT:** A table showing the various configurations and what is enabled when. | Configuration | Dynamic verification performed | LLVM static assertions compiled in | | --- | --- | --- | | alt builds | | yes | | nightly builds | | no | | stable builds | | no | | CI builds | | | | dev builds in a checkout | | |
2018-07-11Deny bare trait objects in in src/librustc_codegen_llvmljedrz-33/+34
2018-07-11Auto merge of #51966 - alexcrichton:llvm7, r=michaelwoeristerbors-109/+77
Upgrade to LLVM's master branch (LLVM 7) ### Current status ~~Blocked on a [performance regression](https://github.com/rust-lang/rust/pull/51966#issuecomment-402320576). The performance regression has an [upstream LLVM issue](https://bugs.llvm.org/show_bug.cgi?id=38047) and has also [been bisected](https://reviews.llvm.org/D44282) to an LLVM revision.~~ Ready to merge! --- This commit upgrades the main LLVM submodule to LLVM's current master branch. The LLD submodule is updated in tandem as well as compiler-builtins. Along the way support was also added for LLVM 7's new features. This primarily includes the support for custom section concatenation natively in LLD so we now add wasm custom sections in LLVM IR rather than having custom support in rustc itself for doing so. Some other miscellaneous changes are: * We now pass `--gc-sections` to `wasm-ld` * The optimization level is now passed to `wasm-ld` * A `--stack-first` option is passed to LLD to have stack overflow always cause a trap instead of corrupting static data * The wasm target for LLVM switched to `wasm32-unknown-unknown`. * The syntax for aligned pointers has changed in LLVM IR and tests are updated to reflect this. * ~~The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug]~~ Nowadays we've been mostly only upgrading whenever there's a major release of LLVM but enough changes have been happening on the wasm target that there's been growing motivation for quite some time now to upgrade out version of LLD. To upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet another version of LLVM on the builders. The revision of LLVM in use here is arbitrarily chosen. We will likely need to continue to update it over time if and when we discover bugs. Once LLVM 7 is fully released we can switch to that channel as well. [llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382 cc #50543
2018-07-10Rollup merge of #52171 - bharrisau:fsub-count, r=estebankGuillaume Gomez-3/+4
Correct some codegen stats counter inconsistencies I noticed some possible typos/inconsistencies in the codegen counters. For example, `fsub` was getting counted as an integer `sub`, whereas `fadd` was counted as an add. And `addincoming` was only being counted on the initial call. https://github.com/rust-lang/rust/blob/dbd10f81758381339f98994b8d31814cf5e98707/src/librustc_codegen_llvm/builder.rs#L831-L841 Only remaining inconsistencies I can see are things like `fadd_fast` are counted as `fadd`. But the vector versions like `vector_reduce_fmax_fast` are counted as `vector.reduce.fmax_fast` not as their 'base' versions (`vector_reduce_fmax` is counted as `vector.reduce.fmax`).
2018-07-10Upgrade to LLVM's master branch (LLVM 7)Alex Crichton-109/+77
This commit upgrades the main LLVM submodule to LLVM's current master branch. The LLD submodule is updated in tandem as well as compiler-builtins. Along the way support was also added for LLVM 7's new features. This primarily includes the support for custom section concatenation natively in LLD so we now add wasm custom sections in LLVM IR rather than having custom support in rustc itself for doing so. Some other miscellaneous changes are: * We now pass `--gc-sections` to `wasm-ld` * The optimization level is now passed to `wasm-ld` * A `--stack-first` option is passed to LLD to have stack overflow always cause a trap instead of corrupting static data * The wasm target for LLVM switched to `wasm32-unknown-unknown`. * The syntax for aligned pointers has changed in LLVM IR and tests are updated to reflect this. * The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug] Nowadays we've been mostly only upgrading whenever there's a major release of LLVM but enough changes have been happening on the wasm target that there's been growing motivation for quite some time now to upgrade out version of LLD. To upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet another version of LLVM on the builders. The revision of LLVM in use here is arbitrarily chosen. We will likely need to continue to update it over time if and when we discover bugs. Once LLVM 7 is fully released we can switch to that channel as well. [llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382
2018-07-10Auto merge of #51583 - cuviper:packed_pair-bool, r=Mark-Simulacrumbors-42/+39
Store scalar pair bools as i8 in memory We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates, to optimize IR for checked operators and the like. With this patch, we still do so when the pair is an immediate value, but we use the `i8` memory type when the value is loaded or stored as an LLVM aggregate. So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }` in memory. When a pair is a direct function argument, `PassMode::Pair`, it is still passed using the immediate `i1` type, but as a return value it will use the `i8` memory type. Also, `bool`-like` enum tags will now use scalar pairs when possible, where they were previously excluded due to optimization issues. Fixes #51516. Closes #51566. r? @eddyb cc @nox
2018-07-09bump minimum LLVM version to 5.0gnzlbg-23/+5
2018-07-09Correct some codegen stats countersBen Harris-3/+4
2018-07-08Auto merge of #51590 - bjorn3:codegen_llvm_extract, r=alexcrichtonbors-284/+6
Mostly fix metadata_only backend and extract some code out of rustc_codegen_llvm Removes dependency on the `ar` crate and removes the `llvm.enabled` config option in favour of setting `rust.codegen-backends` to `[]`.
2018-07-07Auto merge of #52109 - michaelwoerister:ir-objs, r=alexcrichtonbors-6/+5
When doing linker-plugin based LTO, write LLVM bitcode obj-files instead of embedding the bitcode into the regular object file. This PR makes the compiler emit LLVM bitcode object files instead of regular object files with the IR embed when compiling for linker-plugin-based LTO. The reasoning for switching the strategy is this: - Embedding bitcode in a section of the object file actually makes us save bitcode twice in rlibs and Rust dylibs, once for linker-based LTO and once for rustc-based LTO. That's a waste of space. - When compiling for plugin-based LTO, one usually has no use for the machine code also present in the object file. Generating it is a waste of time. - When compiling for plugin-based LTO, `rustc` will skip running ThinLTO because the linker will do that anyway. This has the side effect of then generating poorly optimized machine code, which makes it even less useful (and may lead to users not knowing why their code is slow instead of getting an error). - Not having machine code available makes it impossible for the linker to silently fall back to not inlining stuff across language boundaries. - This is what Clang does and according to [the documentation](https://llvm.org/docs/BitCodeFormat.html#native-object-file-wrapper-format) is the better supported option. - The current behavior (minus the runtime performance problems) is still available via `-Z embed-bitcode` (we might want to do this for `libstd` at some point). r? @alexcrichton
2018-07-07Move llvm_target_features back to llvm_utilbjorn3-2/+116
2018-07-07Move time_graph.rs to rustc/utilbjorn3-1/+1
2018-07-07Update Cargo.lock and move size_and_align_of_dst backbjorn3-107/+132
2018-07-07Undo unnecessary changebjorn3-1/+3
2018-07-07Fix some errorsbjorn3-131/+7
2018-07-07Move some functions out of rustc_codegen_llvm and fix metadata_only backendbjorn3-404/+109
2018-07-06ARM: expose the "mclass" target featureJorge Aparicio-0/+1
2018-07-06Remove CrossLangLto::NoLink which does not have a use case anymore.Michael Woerister-2/+1
2018-07-06When doing linker-plugin based LTO, write LLVM bitcode obj-filesMichael Woerister-4/+4
instead of embedding the bitcode into the regular object file.
2018-07-06Rollup merge of #52055 - crlf0710:patch-3, r=Mark-Simulacrumkennytm-2/+2
Include VS 2017 in error message. Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-07-06Rollup merge of #52019 - michaelwoerister:cross-lto-auto-plugin, r=alexcrichtonkennytm-25/+36
[cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD) This PR allows for not specifying an LTO-linker plugin but still let `rustc` invoke the linker with the correct plugin arguments. This is useful when using LLD which does not need the `-plugin` argument. Since LLD is the best linker for this scenario anyway, this change should improve ergonomics quite a bit. r? @alexcrichton
2018-07-05Update scalar pairs per review commentsJosh Stone-11/+3
2018-07-06rustc_codegen_llvm: replace the first argument early in FnType::new_vtable.Eduard-Mihai Burtescu-37/+43
2018-07-05Store scalar pair bools as i8 in memoryJosh Stone-36/+41
We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates, to optimize IR for checked operators and the like. With this patch, we still do so when the pair is an immediate value, but we use the `i8` memory type when the value is loaded or stored as an LLVM aggregate. So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }` in memory. When a pair is a direct function argument, `PassMode::Pair`, it is still passed using the immediate `i1` type, but as a return value it will use the `i8` memory type. Also, `bool`-like` enum tags will now use scalar pairs when possible, where they were previously excluded due to optimization issues.
2018-07-04Shorten the lineCrLF0710-2/+2
Shorten the line to make tidy happy.
2018-07-04Include VS 2017 in error message.CrLF0710-1/+1
Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-07-03Allow the linker to choose the LTO-plugin (which is useful when using LLD)Michael Woerister-25/+36
2018-07-03Rollup merge of #51982 - michaelwoerister:hash-modules-properly, r=nikomatsakisPietro Albini-3/+2
incr.comp.: Take names of children into account when computing the ICH of a module's HIR. Fixes #40876. Red-green tracking does not make this a problem anymore. We should verify this via a perf-run though. r? @nikomatsakis
2018-07-02incr.comp.: Take names of children into account when computing the ICH of a ↵Michael Woerister-3/+2
module's HIR.
2018-07-02Emit column info in debuginfo for non msvc like targetsest31-4/+10