about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/base.rs
AgeCommit message (Collapse)AuthorLines
2018-10-08codegen_llvm: improve allocationsljedrz-4/+13
2018-10-08codegen_llvm: whitespace & formatting improvementsljedrz-15/+14
2018-09-18incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to ↵Michael Woerister-26/+15
test incremental ThinLTO.
2018-08-31Always add all modules to the global ThinLTO module analysis when compiling ↵Michael Woerister-95/+34
incrementally.
2018-08-31Support local ThinLTO with incremental compilation.Michael Woerister-52/+122
2018-08-31Make codegen not be a query (since it's not a real query anyway).Michael Woerister-13/+22
2018-08-31Persist ThinLTO import data in incr. comp. session directory.Michael Woerister-0/+20
2018-08-22Remove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str}varkor-3/+3
2018-08-22Remove Ty prefix from ↵varkor-16/+16
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-21Rollup merge of #53465 - bjorn3:remove_link_meta_struct, r=varkorkennytm-10/+4
Remove LinkMeta struct Fixes #53291
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-2/+2
2018-08-18Remove LinkMeta structbjorn3-10/+4
2018-08-18Auto merge of #53437 - alexcrichton:fix-target-features, r=michaelwoeristerbors-21/+0
Set more llvm function attributes for __rust_try This shim is generated elsewhere in the compiler so this commit adds support to ensure it goes through similar paths as the rest of the compiler to set llvm function attributes like target features. cc #53372
2018-08-16Set more llvm function attributes for __rust_tryAlex Crichton-21/+0
This shim is generated elsewhere in the compiler so this commit adds support to ensure it goes through similar paths as the rest of the compiler to set llvm function attributes like target features. cc #53372
2018-08-15Use CGU name as LLVM module name and add some caching to CGU name generation.Michael Woerister-43/+24
2018-08-10Introduce SmallCStr and use it where applicable.Michael Woerister-2/+3
2018-08-10Introduce const_cstr!() macro and use it where applicable.Michael Woerister-2/+2
2018-08-09Auto merge of #53031 - michaelwoerister:cross-lto, r=alexcrichtonbors-0/+1
Apply some fixes to cross-language LTO (especially when targeting MSVC) This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory. r? @alexcrichton
2018-08-07rustc: Tweak visibility of some lang itemsAlex Crichton-2/+22
This commit tweaks the linker-level visibility of some lang items that rustc uses and defines. Notably this means that `#[panic_implementation]` and `#[alloc_error_handler]` functions are never marked as `internal`. It's up to the linker to eliminate these, not rustc. Additionally `#[global_allocator]` generated symbols are no longer forced to `Default` visibility (fully exported), but rather they're relaxed to `Hidden` visibility). This symbols are *not* needed across DLL boundaries, only as a local implementation detail of the compiler-injected allocator symbols, so `Hidden` should suffice. Closes #51342 Closes #52795
2018-08-07Annotate functions in LLVM with target-cpu, same as Clang does.Michael Woerister-0/+1
2018-08-04Normalize DebugInfoLevel to standard styleMark Rousskov-2/+2
2018-08-04Normalize EntryFnType variants to standard styleMark Rousskov-3/+3
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-7/+7
This is a clippy-breaking change.
2018-08-02Basic profilingWesley Wiser-0/+3
2018-07-30rustc_codegen_llvm: fix tidy errors.Irina Popa-2/+10
2018-07-30rustc_codegen_llvm: use safe references for Value.Irina Popa-58/+62
2018-07-30rustc_codegen_llvm: use safe references for Metadata and DI*.Irina Popa-3/+3
2018-07-30rustc_codegen_llvm: use safe references for Type.Irina Popa-32/+36
2018-07-30rustc_codegen_llvm: use safe references for Context and Module.Irina Popa-46/+26
2018-07-23Replace a few expect+format combos with unwrap_or_else+panicljedrz-1/+1
2018-07-16rustc: Use link_section, not wasm_custom_sectionAlex Crichton-57/+9
This commit transitions definitions of custom sections on the wasm target from the unstable `#[wasm_custom_section]` attribute to the already-stable-for-other-targets `#[link_section]` attribute. Mostly the same restrictions apply as before, except that this now applies only to statics. Closes #51088
2018-07-16BinOpKindcsmoe-17/+17
2018-07-16Revert "Persist ThinLTO import data in incr. comp. session directory."Michael Woerister-23/+1
This reverts commit 8dc7ddb9763f28b83de7bf3b3025f8042ea9e830.
2018-07-16Revert "Clean up LLVM module naming (just use CodegenUnit names)."Michael Woerister-30/+48
This reverts commit f6894ebe664d111259a91a2b5fcc1236ca413436.
2018-07-16Revert "Use callback-based interface to load ThinLTO import data into rustc."Michael Woerister-1/+1
This reverts commit e045a6cd8c0235a26ef11e6cd9a13ebd817f1265.
2018-07-13Auto merge of #52266 - michaelwoerister:incr-thinlto-preliminaries, ↵bors-49/+53
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-13Use callback-based interface to load ThinLTO import data into rustc.Michael Woerister-1/+1
2018-07-11Clean up LLVM module naming (just use CodegenUnit names).Michael Woerister-48/+30
2018-07-11Persist ThinLTO import data in incr. comp. session directory.Michael Woerister-1/+23
2018-07-11Deny bare trait objects in in src/librustc_codegen_llvmljedrz-1/+1
2018-07-11Auto merge of #51966 - alexcrichton:llvm7, r=michaelwoeristerbors-29/+30
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-10Upgrade to LLVM's master branch (LLVM 7)Alex Crichton-29/+30
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-5/+10
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-07Undo unnecessary changebjorn3-1/+3
2018-07-07Move some functions out of rustc_codegen_llvm and fix metadata_only backendbjorn3-4/+3
2018-07-05Store scalar pair bools as i8 in memoryJosh Stone-5/+10
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-06-28Merge `ConstVal` and `ConstValue`Oliver Schneider-8/+1
2018-06-28Move everything over from `middle::const_val` to `mir::interpret`Oliver Schneider-1/+1
2018-06-14rustc: rename ty::maps to ty::query.Eduard-Mihai Burtescu-1/+1
2018-05-24Don't ICE if crate has no valid crate types leftOliver Schneider-1/+1