summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2018-10-07Revert "Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakis"Ariel Ben-Yehuda-0/+1
This reverts commit 6810f5286b6b91daab06fc3dccb27d8c46f14349, reversing changes made to 8586ec6980462c99a8926646201b2444d8938d29.
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-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.
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-09-11renamed is_nil to is_unitkenta7777-3/+3
2018-09-11Revert "renamed is_nil to is_unit"kenta7777-3/+3
This reverts commit 6f685ffad42a2d12dd1fad5ccb0471e7fa260826.
2018-09-10add the `AscribeUserType` statement kindNiko Matsakis-1/+1
Make it have the semantics of subtype.
2018-09-10renamed mk_nil to mk_unitkenta7777-1/+1
2018-09-10renamed is_nil to is_unitkenta7777-3/+3
2018-09-09Auto merge of #53998 - eddyb:issue-53728, r=oli-obkbors-12/+19
rustc_codegen_llvm: don't assume offsets are always aligned. Fixes #53728 by taking into account not just overall type alignment and the field's alignment when determining whether a field is aligned or not ("packed"), but also the field's offset within the type. Previously, rustc assumed that the offset was always at least as aligned as `min(struct.align, field.align)`. However, there's no real reason to have that assumption, and it obviously can't always be true after we implement `#[repr(align(N), pack(K))]`. There's also a case today where that assumption is not true, involving niche discriminants in enums: Suppose that we have the code in #53728: ```Rust #[repr(u16)] enum DeviceKind { Nil = 0, } #[repr(packed)] struct DeviceInfo { endianness: u8, device_kind: DeviceKind, } struct Wrapper { device_info: DeviceInfo, data: u32 } ``` Observe the layout of `Option<Wrapper>`. It has an alignment of 4 because of the `u32`. `device_info.device_kind` is a good niche field to use, which means the enum ends up with this layout: ``` size = 8 align = 4 fields = [ { offset=1, type=u16 } // discriminant, .<Some>.device_info.device_kind ] ``` And here we have an discriminant with alignment 2 (`u16`) but offset 1.
2018-09-08Auto merge of #53705 - ms2300:tmp, r=oli-obkbors-1/+1
#53576 Renaming TyAnon -> TyOpaque Fixes #53576
2018-09-07make field always private, add `From` implsNiko Matsakis-3/+1
2018-09-06rustc_codegen_llvm: don't assume offsets are always aligned.Eduard-Mihai Burtescu-12/+19
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-05Changing TyAnon -> TyOpaque and relevant functionsms2300-1/+1
2018-09-05Auto merge of #53878 - alexcrichton:wasm-atomics-feature, r=eddybbors-4/+14
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-03Auto merge of #53926 - japaric:arm-features, r=alexcrichtonbors-0/+4
whitelist some ARM features required for rust-lang-nursery/stdsimd#557 r? @gnzlbg or @alexcrichton
2018-09-03whitelist some ARM featuresJorge Aparicio-0/+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/+14
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-359/+159
incrementally.
2018-08-31Support local ThinLTO with incremental compilation.Michael Woerister-256/+608
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-4/+137
2018-08-31Provide a way of accessing the ThinLTO module import map in rustc.Michael Woerister-0/+9
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-29Auto merge of #53642 - alexcrichton:fix-target-cpu-native, r=arielb1bors-3/+25
Fix warnings about the `native` target-cpu 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-29Auto merge of #53671 - RalfJung:miri-refactor, r=oli-obkbors-4/+4
Miri engine cleanup * Unify the two maps in memory to store the allocation and its kind together. * Share the handling of statics between CTFE and miri: The miri engine always uses "lazy" `AllocType::Static` when encountering a static. Acessing that static invokes CTFE (no matter the machine). The machine only has any influence when writing to a static, which CTFE outright rejects (but miri makes a copy-on-write). * Add an `AllocId` to by-ref consts so miri can use them as operands without making copies. * Move responsibilities around for the `eval_fn_call` machine hook: The hook just has to find the MIR (or entirely take care of everything); pushing the new stack frame is taken care of by the miri engine. * Expose the intrinsics and lang items implemented by CTFE so miri does not have to reimplement them. * Allow Machine to hook into foreign statics (used by miri to get rid of some other hacks). * Clean up function calling. * Switch const sanity check to work on operands, not mplaces. * Move const_eval out of rustc_mir::interpret, to make sure that it does not access private implementation details. In particular, we can finally make `eval_operand` take `&self`. :-) Should be merged after https://github.com/rust-lang/rust/pull/53609, across which I will rebase.
2018-08-28Fix warnings about the `native` target-cpuAlex Crichton-3/+25
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-8/+8
2018-08-27Remove path prefixes from NodeKindvarkor-7/+8
2018-08-27Rename hir::map::Node to hir::map::NodeKindvarkor-6/+6
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-27Miri Memory WorkRalf Jung-4/+4
* Unify the two maps in memory to store the allocation and its kind together. * Share the handling of statics between CTFE and miri: The miri engine always uses "lazy" `AllocType::Static` when encountering a static. Acessing that static invokes CTFE (no matter the machine). The machine only has any influence when writing to a static, which CTFE outright rejects (but miri makes a copy-on-write). * Add an `AllocId` to by-ref consts so miri can use them as operands without making copies. * Move responsibilities around for the `eval_fn_call` machine hook: The hook just has to find the MIR (or entirely take care of everything); pushing the new stack frame is taken care of by the miri engine. * Expose the intrinsics and lang items implemented by CTFE so miri does not have to reimplement them.
2018-08-24Auto merge of #53225 - nikomatsakis:nll-type-annot, r=pnkfelixbors-1/+1
MIR: support user-given type annotations on fns, structs, and enums This branch adds tooling to track user-given type annotations on functions, structs, and enum variant expressions. The user-given types are passed onto NLL which then enforces them. cc #47184 — not a complete fix, as there are more cases to cover r? @eddyb cc @rust-lang/wg-compiler-nll
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-24support user-given types in adtsNiko Matsakis-1/+1
2018-08-23Fix an AMDGPU related load bit range metadata assertion.Richard Diamond-0/+8
2018-08-23AMDGPU ignores `noinline` when it slaps `alwaysinline` everywhere.Richard Diamond-5/+10
Allow target specs to disable that attribute.
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-2/+2
or "".into()
2018-08-22Remove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str}varkor-102/+102
2018-08-22Remove Ty prefix from Ty{Foreign|Param}varkor-6/+6
2018-08-22Remove Ty prefix from ↵varkor-107/+107
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}