about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2018-05-24enable fast-math flagsgnzlbg-3/+5
2018-05-24fix tidygnzlbg-6/+16
2018-05-24add simd float intrinsics and gather/scattergnzlbg-0/+488
2018-05-24Auto merge of #51023 - kennytm:rollup, r=kennytmbors-2/+6
Rollup of 9 pull requests Successful merges: - #50864 (Add NetBSD/arm target specs) - #50956 (rust-gdb: work around the re-used -d argument in cgdb) - #50964 (Make sure that queries have predictable symbol names.) - #50965 (Update LLVM to pull in another wasm fix) - #50972 (Add -Z no-parallel-llvm flag) - #50979 (Fix span for type-only arguments) - #50981 (Shrink `LiveNode`.) - #50995 (move type out of unsafe block) - #51011 ( rustdoc: hide macro export statements from docs) Failed merges:
2018-05-24Auto merge of #50949 - eddyb:debuginfo, r=mwbors-33/+5
rustc_codegen_llvm: remove some debuginfo cruft. (The second commit passes tests locally but might not on older LLVM versions) r? @nikomatsakis
2018-05-24Rollup merge of #50972 - nikic:no-parallel, r=michaelwoeristerkennytm-2/+6
Add -Z no-parallel-llvm flag Codegen issues commonly only manifest under specific circumstances, e.g. if multiple codegen units are used and ThinLTO is enabled. However, these configuration are threaded, making the use of LLVM debugging facilities hard, as output is interleaved. This patch adds a -Z no-parallel-llvm flag, which allows disabling parallelization of codegen and linking, while otherwise preserving behavior with regard to codegen units and LTO.
2018-05-22Add -Z no-parallel-llvm flagNikita Popov-2/+6
Codegen issues commonly only manifest under specific circumstances, e.g. if multiple codegen units are used and ThinLTO is enabled. However, these configuration are threaded, making the use of LLVM debugging facilities hard, as output is interleaved. This patch adds a -Z no-parallel-llvm flag, which allows disabling parallelization of codegen and linking, while otherwise preserving behavior with regard to codegen units and LTO.
2018-05-22Use SortedMap instead of BTreeMap for relocations in MIRI.Michael Woerister-1/+1
2018-05-22Introduce AllocType which indicates what AllocIds point toJohn Kåre Alsaker-26/+22
2018-05-21rustc_codegen_llvm: remove closure env alloca hack around upvar debuginfo.Eduard-Mihai Burtescu-22/+2
2018-05-21rustc_codegen_llvm: remove debuginfo::VariableKind::CapturedVariable.Eduard-Mihai Burtescu-11/+3
2018-05-21rustc: use intern_* instead of mk_* where possible.Eduard-Mihai Burtescu-2/+4
2018-05-21rustc: don't call Kind::from directly, use .into() instead.Eduard-Mihai Burtescu-2/+1
2018-05-20Auto merge of #50841 - oli-obk:promote_errors_to_panics, r=eddybbors-2/+2
Don't lint numeric overflows in promoteds in release mode r? @eddyb mitigates #50814
2018-05-20Auto merge of #50803 - varkor:never-transmute-never, r=eddybbors-3/+14
Fix an ICE when attempting to transmute an uninhabited type Fixes https://github.com/rust-lang/rust/issues/50570.
2018-05-19Auto merge of #50893 - kennytm:rollup, r=kennytmbors-8/+17
Rollup of 8 pull requests Successful merges: - #50531 (Cleanup uses of TypeIdHasher and replace them with StableHasher) - #50819 (Fix potential divide by zero) - #50827 (Update LLVM to 56c931901cfb85cd6f7ed44c7d7520a8de1edf97) - #50829 (CheckLoopVisitor: also visit break expressions) - #50854 (in which the unused shorthand field pattern debacle/saga continues) - #50858 (Reorder description for snippets in rustdoc documentation) - #50883 (Fix warning when building stage0 libcore) - #50889 (Update clippy) Failed merges:
2018-05-20Rollup merge of #50819 - cjkenn:cjkenn/div-by-zero, r=kennytmkennytm-2/+6
Fix potential divide by zero This should fix #50761 I had trouble reproducing with the provided code, but looking at the stack trace would indicate that this code is the likely cause. I made a number of assumptions here, because I don't have enough context on how the register size is set: 1. I assumed `rest.unit.size.bytes()` can be 0, and it's ok if it's set to 0 before this function is called 2. I assumed that if `rest.unit.size.bytes()` is 0, that we want `rest_count` to also be 0.
2018-05-19use if let to avoid potential div by zerocjkenn-2/+6
remove semicolon -_- Add rem_bytes to conditional to avoid error when performing mod by 0 Add test file to confirm compilation passes. Ensure we don't divide or mod by zero in llvm_type. Include test file from issue.
2018-05-19Rollup merge of #50531 - iancormac84:merge-typeidhasher-cleanup, ↵kennytm-6/+11
r=michaelwoerister Cleanup uses of TypeIdHasher and replace them with StableHasher Fixes #50424 r? @michaelwoerister
2018-05-19Use `Size` instead of `u64` in mir interpretationOliver Schneider-5/+6
2018-05-19Go through an allocation when accessing fields of constantsOliver Schneider-4/+10
2018-05-19Ensure that statics are always ByRefOliver Schneider-46/+3
2018-05-19Add a test showing the erroneous promoted bugOliver Schneider-2/+2
2018-05-19Auto merge of #50744 - nikic:mutable-noalias, r=alexcrichtonbors-2/+8
Emit noalias on &mut parameters by default This used to be disabled due to LLVM bugs in the handling of noalias information in conjunction with unwinding. However, according to #31681 all known LLVM bugs have been fixed by LLVM 6.0, so it's probably time to reenable this optimization. -Z no-mutable-noalias is left as an escape-hatch to debug problems suspected to stem from this change.
2018-05-19Auto merge of #50709 - alexcrichton:revert-musl, r=sfacklerbors-27/+0
Revert #50105 until regression is fixed Discovered at https://github.com/rust-lang/rust/pull/50105#issuecomment-388630750 it looks like this caused a regression with i686 musl, so let's revert in the meantime while a fix is worked out
2018-05-18Auto merge of #50319 - nagisa:align_to, r=alexcrichtonbors-12/+0
Implement [T]::align_to Note that this PR deviates from what is accepted by RFC slightly by making `align_offset` to return an offset in elements, rather than bytes. This is necessary to sanely support `[T]::align_to` and also simply makes more sense™. The caveat is that trying to align a pointer of ZST is now an equivalent to `is_aligned` check, rather than anything else (as no number of ZST elements will align a misaligned ZST pointer). It also implements the `align_to` slightly differently than proposed in the RFC to properly handle cases where size of T and U aren’t co-prime. Furthermore, a promise is made that the slice containing `U`s will be as large as possible (contrary to the RFC) – otherwise the function is quite useless. The implementation uses quite a few underhanded tricks and takes advantage of the fact that alignment is a power-of-two quite heavily to optimise the machine code down to something that results in as few known-expensive instructions as possible. Currently calling `ptr.align_offset` with an unknown-at-compile-time `align` results in code that has just a single "expensive" modulo operation; the rest is "cheap" arithmetic and bitwise ops. cc https://github.com/rust-lang/rust/issues/44488 @oli-obk As mentioned in the commit message for align_offset, many thanks go to Chris McDonald.
2018-05-17Fixed accidental removal of StableHasher declaration.iancormac84-0/+1
2018-05-17Removed use of TypeIdHasher in debuginfo and replaced it with StableHasher. ↵iancormac84-6/+10
Also corrected erroneous mention of TypeIdHasher in implementation of HashStable trait.
2018-05-17Emit noalias on &mut parameters by defaultNikita Popov-2/+8
This used to be disabled due to LLVM bugs in the handling of noalias information in conjunction with unwinding. However, according to #31681 all known LLVM bugs have been fixed by LLVM 6.0, so it's probably time to reenable this optimization. Noalias annotations will not be emitted by default if either -C panic=abort (as previously) or LLVM >= 6.0 (new). -Z mutable-noalias=no is left as an escape-hatch to allow debugging problems suspected to stem from this change.
2018-05-17Remove the intrinsic for align_offsetSimonas Kazlauskas-26/+0
Keep only the language item. This removes some indirection and makes codegen worse for debug builds, but simplifies code significantly, which is a good tradeoff to make, in my opinion. Besides, the codegen can be improved even further with some constant evaluation improvements that we expect to happen in the future.
2018-05-17Stabilise inclusive_range_methodsvarkor-1/+0
2018-05-17Change align_offset to support different stridesSimonas Kazlauskas-9/+23
This is necessary if we want to implement `[T]::align_to` and is more useful in general. This implementation effort has begun during the All Hands and represents a month of my futile efforts to do any sort of maths. Luckily, I found the very very nice Chris McDonald (cjm) on IRC who figured out the core formulas for me! All the thanks for existence of this PR go to them! Anyway… Those formulas were mangled by yours truly into the arcane forms you see here to squeeze out the best assembly possible on most of the modern architectures (x86 and ARM were evaluated in practice). I mean, just look at it: *one actual* modulo operation and everything else is just the cheap single cycle ops! Admitedly, the naive solution might be faster in some common scenarios, but this code absolutely butchers the naive solution on the worst case scenario. Alas, the result of this arcane magic also means that the code pretty heavily relies on the preconditions holding true and breaking those preconditions will unleash the UB-est of all UBs! So don’t.
2018-05-17Revert "musl: don't use the included startfiles with -crt-static"Alex Crichton-16/+0
This reverts commit a5a875d17b34b61326d803eb2edea526d3bd6914.
2018-05-17Revert "musl: link crt{begin,end}.o from the system compiler"Alex Crichton-11/+0
This reverts commit 6d9154a830dd9773fe8a4e34e1fc3dfb1ca6f935.
2018-05-17Make sure the type we think is uninhabited actually isvarkor-1/+2
2018-05-17Fix an ICE when attempting to transmute an uninhabited typevarkor-3/+13
2018-05-17Rename trans to codegen everywhere.Irina Popa-0/+24579