about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2018-10-03Record whether a Call in MIR corresponds to a call in HIRMatthew Jasper-1/+7
2018-10-03Introduce `TyKind::UnnormalizedProjection`scalexm-0/+1
2018-10-02wasm: Explicitly export all symbols with LLDAlex Crichton-1/+6
This commit fixes an oddity on the wasm target where LTO can produce working executables but plain old optimizations doesn't. The compiler already knows what set of symbols it would like to export, but LLD only discovers this list transitively through symbol visibilities. LLD may not, however, always find all the symbols that we'd like to export. For example if you depend on an rlib with a `#[no_mangle]` symbol, then if you don't actually use anything from the rlib then the symbol won't appear in the final artifact! It will appear, however, with LTO. This commit attempts to rectify this situation by ensuring that all symbols rustc would otherwise preserve through LTO are also preserved through the linking process with LLD by default.
2018-10-01Auto merge of #54693 - RalfJung:ctfe-scalar-pair-undef, r=oli-obkbors-11/+7
do not normalize all non-scalar constants to a ConstValue::ScalarPair We still need `ConstValue::ScalarPair` for match handling (matching slices and strings), but that will never see anything `Undef`. For non-fat-ptr `ScalarPair`, just point to the allocation like larger data structures do. Fixes https://github.com/rust-lang/rust/issues/54387 r? @eddyb
2018-10-01Auto merge of #54667 - RalfJung:maybe-uninit, r=pnkfelixbors-6/+54
Panic when using mem::uninitialized or mem::zeroed on an uninhabited type All code by @japaric. This re-submits one half of https://github.com/rust-lang/rust/pull/53508. This is likely not the one that introduced the perf regression, but just to be sure I'll do a perf run anyway.
2018-10-01Auto merge of #54675 - alexcrichton:defaultlibs, r=varkorbors-6/+10
rust: Add a `-C default-linker-libraries` option This commit adds a new codegen option for the compiler which disables rustc's passing of `-nodefaultlibs` by default on relevant platforms. Sometimes Rust is linked with C code which fails to link with `-nodefaultlibs` and is unnecessarily onerous to get linking correctly with `-nodefaultlibs`. An example of this is that when you compile C code with sanitizers and then pass `-fsanitize=address` to the linker, it's incompatible with `-nodefaultlibs` also being passed to the linker. In these situations it's easiest to turn off Rust's default passing of `-nodefaultlibs`, which was more ideological to start with than anything! Preserving the default is somewhat important but having this be opt-in shouldn't cause any breakage. Closes #54237
2018-09-30adapt to change in Session APIJorge Aparicio-1/+1
2018-09-30move our check to reuse a previous computationJorge Aparicio-20/+21
2018-09-30improve panic messageJorge Aparicio-8/+6
2018-09-30use is_uninhabited in more placesJorge Aparicio-6/+6
2018-09-30panic when instantiating an uninhabited type via mem::{uninitialized,zeroed}Jorge Aparicio-0/+49
2018-09-30do not normalize non-scalar constants to a ConstValue::ScalarPairRalf Jung-11/+7
2018-09-30Auto merge of #54639 - nagisa:lets-alias-for-now, r=eddybbors-7/+12
Do not put noalias annotations by default This will be re-enabled sooner or later depending on results of further investigation. Fixes #54462 Beta backport is: #54640 r? @nikomatsakis
2018-09-30Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrumbors-1/+1
Bump to 1.31.0 and bootstrap from 1.30 beta Closes #54594.
2018-09-29rust: Add a `-C default-linker-libraries` optionAlex Crichton-6/+10
This commit adds a new codegen option for the compiler which disables rustc's passing of `-nodefaultlibs` by default on relevant platforms. Sometimes Rust is linked with C code which fails to link with `-nodefaultlibs` and is unnecessarily onerous to get linking correctly with `-nodefaultlibs`. An example of this is that when you compile C code with sanitizers and then pass `-fsanitize=address` to the linker, it's incompatible with `-nodefaultlibs` also being passed to the linker. In these situations it's easiest to turn off Rust's default passing of `-nodefaultlibs`, which was more ideological to start with than anything! Preserving the default is somewhat important but having this be opt-in shouldn't cause any breakage. Closes #54237
2018-09-29Do not put noalias annotations by defaultSimonas Kazlauskas-7/+12
This will be re-enabled sooner or later depending on results of further investigation. Fixes #54462
2018-09-29Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"Ralf Jung-54/+6
This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.
2018-09-28Auto merge of #54356 - Xanewok:save-analysis-invocation, r=nrcbors-10/+2
Emit used rustc invocation in the save-analysis file Blocked on https://github.com/nrc/rls-data/pull/19. (I'm guessing it won't pass CI due to an out-of-tree git dependency) This should allow RLS to recreate a Rust compilation build plan from the save-analysis files alone, which should be useful when fetching those from external build systems, most notably Buck now. Also this includes some more potentially useful compilation-specific options (e.g. sysroot or the actual path to extern crates) but that's not required for the build plan bits. cc @jsgf @alexcrichton r? @nrc
2018-09-28Auto merge of #54568 - levex:issue-54130, r=nagisabors-6/+49
codegen_llvm: check inline assembly constraints with LLVM ---%<--- Hey all, As issue #54130 highlights, constraints are not checked and passing bad constraints to LLVM can crash it since a `Verify()` call is placed inside an assertion (see: `src/llvm/lib/IR/InlineAsm.cpp:39`). As this is my first PR to the Rust compiler (woot! :tada:), there might be better ways of achieving this result. In particular, I am not too happy about generating an error in codegen; it would be much nicer if we did it earlier. However, @rkruppe [noted on IRC](https://botbot.me/mozilla/rustc/2018-09-25/?msg=104791581&page=1) that this should be fine for an unstable feature and a much better solution than the _status quo_, which is an ICE. Thanks! --->%--- LLVM provides a way of checking whether the constraints and the actual inline assembly make sense. This commit introduces a check before emitting code for the inline assembly. If LLVM rejects the inline assembly (or its constraints), then the compiler emits an error E0668 ("malformed inline assembly"). Fixes: #54130 Signed-off-by: Levente Kurusa \<lkurusa@acm.org\>
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-28Auto merge of #54547 - AstralSorcerer:issue-54028, r=eddybbors-4/+1
Rely only on base alignment and offset for computing field alignment Fix #54028 r? @eddyb
2018-09-28Move `filename_for_metadata` to codegen_utilsIgor Matuszewski-10/+2
This function isn't strictly tied to LLVM (it's more of a utility) and it's now near an analogous, almost identical `filename_for_input` (for rlibs and so forth). Also this means not depending on the backend when one wants to know the accurate .rmeta output filename.
2018-09-26add -Z emit-stack-sizesJorge Aparicio-1/+4
2018-09-26fixup! codegen_llvm: check inline assembly constraints with LLVMLevente Kurusa-1/+1
2018-09-26fixup! codegen_llvm: check inline assembly constraints with LLVMLevente Kurusa-1/+1
2018-09-26fixup! codegen_llvm: check inline assembly constraints with LLVMLevente Kurusa-2/+3
2018-09-25codegen_llvm: check inline assembly constraints with LLVMLevente Kurusa-6/+48
LLVM provides a way of checking whether the constraints and the actual inline assembly make sense. This commit introduces a check before emitting code for the inline assembly. If LLVM rejects the inline assembly (or its constraints), then the compiler emits an error E0668 ("malformed inline assembly"). Signed-off-by: Levente Kurusa <lkurusa@acm.org>
2018-09-24Rely only on base alignment and offset for computing field alignmentColin Pronovost-4/+1
Fix #54028
2018-09-23Auto merge of #54380 - RalfJung:miri-snapshot, r=eddybbors-1/+1
move CTFE engine snapshot state out of miri engine into CTFE machine instance It still lives in the `interpret` module as it needs access to all sorts of private stuff. Also rename a thing to make @eddyb happy :D The goal was not to change any behavior.
2018-09-23Auto merge of #54325 - michaelwoerister:incr-thinlto-tests, r=alexcrichtonbors-26/+24
incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to test incremental ThinLTO. This adds some tests specifically targeted at incremental ThinLTO, plus the infrastructure for tracking the kind of cache hit/miss we had for a given CGU. @alexcrichton, let me know if you can think of any more tests to add. ThinLTO works rather reliably for small functions, so we should be able to test it in a robust way. I think after this lands it might time for a "Help us test incremental ThinLTO" post on irlo. r? @alexcrichton
2018-09-22Auto merge of #53508 - japaric:maybe-uninit, r=RalfJungbors-6/+54
Implement `MaybeUninit` This PR: - Adds `MaybeUninit` (see #53491) to `{core,std}::mem`. - Makes `mem::{uninitialized,zeroed}` panic when they are used to instantiate an uninhabited type. - Does *not* deprecate `mem::{uninitialized,zeroed}` just yet. As per https://github.com/rust-lang/rust/issues/53491#issuecomment-414147666, we should not deprecate them until `MaybeUninit` is stabilized. - It replaces uses of `mem::{uninitialized,zeroed}` in core and alloc with `MaybeUninit`. There are still several instances of `mem::{uninitialized,zeroed}` in `std` that *this* PR doesn't address. r? @RalfJung cc @eddyb you may want to look at the new panicking logic
2018-09-22Auto merge of #54188 - lqd:fallout-53695, r=nikomatsakisbors-1/+1
NLL: disallow creation of immediately unusable variables Fix #53695 Original description follows ---- This WIP PR is for discussing the impact of fixing #53695 by injecting a fake read in let patterns. (Travis will fail, at least the `mir-opt` suite is failing in its current state)
2018-09-22move our check to reuse a previous computationJorge Aparicio-20/+21
2018-09-22improve panic messageJorge Aparicio-8/+6
2018-09-22use is_uninhabited in more placesJorge Aparicio-6/+6
2018-09-22adapt to change in Session APIJorge Aparicio-1/+1
2018-09-22panic when instantiating an uninhabited type via mem::{uninitialized,zeroed}Jorge Aparicio-0/+49
2018-09-20Rollup merge of #54258 - alexcrichton:lld-fatal-warnings, r=eddybkennytm-0/+4
Enable fatal warnings for the wasm32 linker Historically LLD has emitted warnings for various reasons but all the bugs have since been fixed (yay!) and by enabling fatal warnings we should be able to head off bugs like #53390 sooner.
2018-09-20Rollup merge of #54233 - irinagpopa:llvm-3.9, r=tromeykennytm-16/+4
Remove LLVM 3.9 workaround.
2018-09-20rename evaluator -> interpreter to make eddyb happyRalf Jung-1/+1
2018-09-18incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to ↵Michael Woerister-26/+24
test incremental ThinLTO.
2018-09-18Refactor 'ReadForMatch' into 'FakeRead' and add the cause of the fake readRemy Rakic-1/+1
2018-09-18Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.Nicholas Nethercote-10/+10
Currently we have two files implementing bitsets (and 2D bit matrices). This commit combines them into one, taking the best features from each. This involves renaming a lot of things. The high level changes are as follows. - bitvec.rs --> bit_set.rs - indexed_set.rs --> (removed) - BitArray + IdxSet --> BitSet (merged, see below) - BitVector --> GrowableBitSet - {,Sparse,Hybrid}IdxSet --> {,Sparse,Hybrid}BitSet - BitMatrix --> BitMatrix - SparseBitMatrix --> SparseBitMatrix The changes within the bitset types themselves are as follows. ``` OLD OLD NEW BitArray<C> IdxSet<T> BitSet<T> -------- ------ ------ grow - grow new - (remove) new_empty new_empty new_empty new_filled new_filled new_filled - to_hybrid to_hybrid clear clear clear set_up_to set_up_to set_up_to clear_above - clear_above count - count contains(T) contains(&T) contains(T) contains_all - superset is_empty - is_empty insert(T) add(&T) insert(T) insert_all - insert_all() remove(T) remove(&T) remove(T) words words words words_mut words_mut words_mut - overwrite overwrite merge union union - subtract subtract - intersect intersect iter iter iter ``` In general, when choosing names I went with: - names that are more obvious (e.g. `BitSet` over `IdxSet`). - names that are more like the Rust libraries (e.g. `T` over `C`, `insert` over `add`); - names that are more set-like (e.g. `union` over `merge`, `superset` over `contains_all`, `domain_size` over `num_bits`). Also, using `T` for index arguments seems more sensible than `&T` -- even though the latter is standard in Rust collection types -- because indices are always copyable. It also results in fewer `&` and `*` sigils in practice.
2018-09-15Enable fatal warnings for the wasm32 linkerAlex Crichton-0/+4
Historically LLD has emitted warnings for various reasons but all the bugs have since been fixed (yay!) and by enabling fatal warnings we should be able to head off bugs like #53390 sooner.
2018-09-14Remove LLVM 3.9 workaround.Unknown-16/+4
2018-09-14Rollup merge of #54095 - kenta7777:kenta7777#53719, r=davidtwcokennytm-4/+4
Rename all mentions of `nil` to `unit` Fixes #53719. Renamed keywords nil to unit.
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-12Merge branch 'master' into kenta7777#53719kenta7777-6/+19
2018-09-12Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakisbors-1/+0
stabilize outlives requirements https://github.com/rust-lang/rust/issues/44493 r? @nikomatsakis
2018-09-12Rollup merge of #52514 - DiamondLovesYou:amdgpu-fixes, r=eddybkennytm-5/+18
Fix a few AMDGPU related issues * AMDGPU ignores `noinline` and sadly doesn't clear the attribute when it slaps `alwaysinline` on everything, * an AMDGPU related load bit range metadata assertion, * I didn't enable the `amdgpu` component in the `librustc_llvm` build script, * Add AMDGPU call abi info.