summary refs log tree commit diff
path: root/src/test/codegen
AgeCommit message (Collapse)AuthorLines
2018-05-01Auto merge of #48786 - nagisa:fp, r=nikomatsakisbors-0/+16
Add force-frame-pointer flag to allow control of frame pointer ommision Rebase of #47152 plus some changes suggested by https://github.com/rust-lang/rust/issues/48785. Fixes #11906 r? @nikomatsakis
2018-05-01Rework force-frame-pointerSimonas Kazlauskas-1/+1
This reworks the force-frame-pointer PR to explicitly only consider the value of the flag if it is provided, and use a target default otherwise. Something that was tried but not kept was renaming the flag to `frame-pointer`, because for flag `frame-pointer=no`, there is no guarante, that LLVM will elide *all* the frame pointers; oposite of what the literal reading of the flag would suggest.
2018-05-01Don't force-enable frame pointers when generating debug infoBjörn Steinbrink-0/+16
We apparently used to generate bad/incomplete debug info causing debuggers not to find symbols of stack allocated variables. This was somehow worked around by having frame pointers. With the current codegen, this seems no longer necessary, so we can remove the code that force-enables frame pointers whenever debug info is requested. Since certain situations, like profiling code profit from having frame pointers, we add a -Cforce-frame-pointers flag to always enable frame pointers. Fixes #11906
2018-05-01Auto merge of #50304 - nox:uninhabited-output, r=eddybbors-6/+16
Mark functions returning uninhabited types as noreturn
2018-04-28Add `-C target-feature` to all functionsAlex Crichton-0/+19
Previously the features specified to LLVM via `-C target-feature` were only reflected in the `TargetMachine` but this change *also* reflects these and the base features inside each function itself. This change matches clang and... Closes rust-lang-nursery/stdsimd#427
2018-04-28Mark functions returning uninhabited types as noreturnAnthony Ramine-6/+16
2018-04-28Auto merge of #50164 - nox:rval-range-metadata, r=eddybbors-0/+29
Emit range metadata on calls returning scalars (fixes #50157)
2018-04-27Auto merge of #49420 - nox:enum-scalarpair, r=eddybbors-6/+17
Use ScalarPair for tagged enums
2018-04-26Emit range metadata on calls returning scalars (fixes #50157)Anthony Ramine-0/+29
2018-04-26Use ScalarPair for tagged enumsAnthony Ramine-6/+17
2018-04-21rustc: Always emit `uwtable` on AndroidAlex Crichton-0/+1
Long ago (#40549) we enabled the `uwtable` attribute on Windows by default (even with `-C panic=abort`) to allow unwinding binaries for [stack unwinding information][winstack]. It looks like this same issue is [plaguing][arm1] Gecko's Android platforms [as well][arm2]. This commit applies the same fix as #40549 except that this time it's applied for all Android targets. Generating a `-C panic=abort` binary for `armv7-linux-androideabi` before this commit generated a number of `cantunwind` functions (detected with `readelf -u`) but after this commit they all list appropriate unwind information. Closes #49867 [winstack]: https://bugzilla.mozilla.org/show_bug.cgi?id=1302078 [arm1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1453220 [arm2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1451741
2018-04-12Auto merge of #48528 - bitshifter:repr_packed, r=eddybbors-13/+71
Implementation of `#[repr(packed(n))]` RFC 1399. Tracking issue https://github.com/rust-lang/rust/issues/33158.
2018-04-11Implementation of `#[repr(packed(n))]` RFC 1399.Cameron Hart-13/+71
2018-04-10Small nits to make couple of tests pass on mips targets.dragan.mladjenovic-0/+6
2018-04-06Make sure that generics are internalized in executables even with ↵Michael Woerister-0/+22
-Zshare-generics
2018-04-04Auto merge of #48171 - FraGag:doc-copy-clone-impls, r=nikomatsakisbors-1/+6
Better document the implementors of Clone and Copy There are two parts to this change. The first part is a change to the compiler and to the standard library (specifically, libcore) to allow implementations of `Clone` and `Copy` to be written for a subset of builtin types. By adding these implementations to libcore, they now show up in the documentation. This is a [breaking-change] for users of `#![no_core]`, because they will now have to supply their own copy of the implementations of `Clone` and `Copy` that were added in libcore. The second part is purely a documentation change to document the other implementors of `Clone` and `Copy` that cannot be described in Rust code (yet) and are thus provided by the compiler. Fixes #25893
2018-03-29Ignore stack-probes tests on powerpc/s390x tooJosh Stone-0/+1
We only support stack probes on x86 and x86_64. Other arches are already ignored.
2018-03-28Auto merge of #49383 - nox:scalarpair, r=eddybbors-0/+6
Allow niche-filling dataful variants to be represented as a ScalarPair r? @eddyb
2018-03-27Auto merge of #49249 - gnzlbg:simd_minmax, r=alexcrichtonbors-0/+43
implement minmax intrinsics This adds the `simd_{fmin,fmax}` intrinsics, which do a vertical (lane-wise) `min`/`max` for floating point vectors that's equivalent to Rust's `min`/`max` for `f32`/`f64`. It might make sense to make `{f32,f64}::{min,max}` use the `minnum` and `minmax` intrinsics as well. --- ~~HELP: I need some help with these. Either I should go to sleep or there must be something that I must be missing. AFAICT I am calling the `maxnum` builder correctly, yet rustc/LLVM seem to insert a call to `llvm.minnum` there instead...~~ EDIT: Rust's LLVM version is too old :/
2018-03-26Strengthen the repeat-trusted-len testFrancis Gagné-1/+6
Simply checking for the presence of `llvm.memset` is too brittle because this instrinsic can be used for seemingly trivial operations, such as zero-initializing a `RawVec`.
2018-03-26Allow niche-filling dataful variants to be represented as a ScalarPairAnthony Ramine-0/+6
2018-03-26Stabilize i128_typeMark Mansi-1/+0
2018-03-26fix testsgnzlbg-2/+2
2018-03-26set min-llvm-version 6.0, ignore-emscriptengnzlbg-0/+3
2018-03-26add testsgnzlbg-0/+40
2018-03-26Auto merge of #49297 - scottmcm:offset-from, r=dtolnaybors-0/+30
Introduce unsafe offset_from on pointers Adds intrinsics::exact_div to take advantage of the unsafe, which reduces the implementation from ```asm sub rcx, rdx mov rax, rcx sar rax, 63 shr rax, 62 lea rax, [rax + rcx] sar rax, 2 ret ``` down to ```asm sub rcx, rdx sar rcx, 2 mov rax, rcx ret ``` (for `*const i32`) See discussion on the `offset_to` tracking issue https://github.com/rust-lang/rust/issues/41079 Some open questions - Would you rather I split the intrinsic PR from the library PR? - Do we even want the safe version of the API? https://github.com/rust-lang/rust/issues/41079#issuecomment-374426786 I've added some text to its documentation that even if it's not UB, it's useless to use it between pointers into different objects. and todos - [x] ~~I need to make a codegen test~~ Done - [x] ~~Can the subtraction use nsw/nuw?~~ No, it can't https://github.com/rust-lang/rust/pull/49297#discussion_r176697574 - [x] ~~Should there be `usize` variants of this, like there are now `add` and `sub` that you almost always want over `offset`? For example, I imagine `sub_ptr` that returns `usize` and where it's UB if the distance is negative.~~ Can wait for later; C gives a signed result https://github.com/rust-lang/rust/issues/41079#issuecomment-375842235, so we might as well, and this existing to go with `offset` makes sense.
2018-03-25Auto merge of #49141 - gnzlbg:simd_select, r=alexcrichtonbors-0/+35
adds simd_select intrinsic The select SIMD intrinsic is used to select elements from two SIMD vectors using a mask: ```rust let mask = b8x4::new(true, false, false, true); let a = f32x4::new(1., 2., 3., 4.); let b = f32x4::new(5., 6., 7., 8.); assert_eq!(simd_select(mask, a, b), f32x4::new(1., 6., 7., 4.)); ``` The number of lanes between the mask and the vectors must match, but the vector width of the mask does not need to match that of the vectors. The mask is required to be a vector of signed integers. Note: this intrinsic will be exposed via `std::simd`'s vector masks - users are not expected to use it directly.
2018-03-23Add a codegen test for exact_div intrinsicScott McMurray-0/+30
2018-03-19Revert "Remove useless powerpc64 entry from ARCH_TABLE, closes #47737"varkor-0/+10
This reverts commit 16ac85ce4dce1e185f2e6ce27df3833e07a9e502.
2018-03-18add codegen testgnzlbg-0/+35
2018-03-09test: fix repr-transparent-aggregates test on mips64James Cowgill-0/+50
Since #47964 was merged, 64-bit mips started passing all structures using 64-bit chunks regardless of their contents. The repr-transparent-aggregates tests needs updating to cope with this.
2018-03-09test: ignore mips* in x86_mmx testJames Cowgill-0/+2
2018-03-09test: ignore stack probe tests on mips*James Cowgill-0/+2
2018-03-09test: remove duplicate ignore-aarch64 from stack-probes testJames Cowgill-1/+0
2018-03-08test: ignore mips64 in abi-main-signature-16bit-c-int.rsJames Cowgill-0/+1
2018-03-08test: remove useless ignore-mips*el headersJames Cowgill-8/+0
2018-03-08Adjust test which differs between 32 bit and 64 bitOliver Schneider-2/+2
The differences are not part of what the test is testing, so they were simply removed.
2018-03-08Codegen testsOliver Schneider-7/+7
2018-03-04Remove useless powerpc64 entry from ARCH_TABLE, closes #47737debris-10/+0
2018-02-28Rollup merge of #48380 - nikomatsakis:issue-48251-master, r=acrichtoManish Goregaokar-1/+1
Fixes #47311. r? @nrc
2018-02-28Rollup merge of #48359 - jsgf:remap-path-prefix, r=sanxiynManish Goregaokar-2/+2
Fixes #47311. r? @nrc
2018-02-22Implement --remap-path-prefixJeremy Fitzhardinge-2/+2
Remove experimental -Zremap-path-prefix-from/to, and replace it with the stabilized --remap-path-prefix=from=to variant. This is an implementation for issue of #41555.
2018-02-20make `#[unwind]` attribute specify expectations more clearlyNiko Matsakis-1/+1
You can now choose between the following: - `#[unwind(allowed)]` - `#[unwind(aborts)]` Per rust-lang/rust#48251, the default is `#[unwind(allowed)]`, though I think we should change this eventually.
2018-02-20rustc_mir: always run the deaggregator.Eduard-Mihai Burtescu-7/+7
2018-02-11Auto merge of #47614 - dotdash:x86_64_sysv_ffi, r=eddybbors-51/+87
Fix oversized loads on x86_64 SysV FFI calls The x86_64 SysV ABI should use exact sizes for small structs passed in registers, i.e. a struct that occupies 3 bytes should use an i24, instead of the i32 it currently uses. Refs #45543
2018-02-08Fix oversized loads on x86_64 SysV FFI callsBjörn Steinbrink-51/+87
The x86_64 SysV ABI should use exact sizes for small structs passed in registers, i.e. a struct that occupies 3 bytes should use an i24, instead of the i32 it currently uses. Refs #45543
2018-02-07Rollup merge of #47944 - oberien:unboundediterator-trustedlen, r=blussManish Goregaokar-0/+23
Implement TrustedLen for Take<Repeat> and Take<RangeFrom> This will allow optimization of simple `repeat(x).take(n).collect()` iterators, which are currently not vectorized and have capacity checks. This will only support a few aggregates on `Repeat` and `RangeFrom`, which might be enough for simple cases, but doesn't optimize more complex ones. Namely, Cycle, StepBy, Filter, FilterMap, Peekable, SkipWhile, Skip, FlatMap, Fuse and Inspect are not marked `TrustedLen` when the inner iterator is infinite. Previous discussion can be found in #47082 r? @alexcrichton
2018-02-06Rollup merge of #46030 - Zoxc:asm-volatile, r=nikomatsakiskennytm-0/+26
Make inline assembly volatile if it has no outputs. Fixes #46026
2018-02-05Make inline assembly volatile if it has no outputs. Fixes #46026John Kåre Alsaker-0/+26
2018-02-04Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichtonkennytm-1/+1
Use a range to identify SIGSEGV in stack guards Previously, the `guard::init()` and `guard::current()` functions were returning a `usize` address representing the top of the stack guard, respectively for the main thread and for spawned threads. The `SIGSEGV` handler on `unix` targets checked if a fault was within one page below that address, if so reporting it as a stack overflow. Now `unix` targets report a `Range<usize>` representing the guard memory, so it can cover arbitrary guard sizes. Non-`unix` targets which always return `None` for guards now do so with `Option<!>`, so they don't pay any overhead. For `linux-gnu` in particular, the previous guard upper-bound was `stackaddr + guardsize`, as the protected memory was *inside* the stack. This was a glibc bug, and starting from 2.27 they are moving the guard *past* the end of the stack. However, there's no simple way for us to know where the guard page actually lies, so now we declare it as the whole range of `stackaddr ± guardsize`, and any fault therein will be called a stack overflow. This fixes #47863.