about summary refs log tree commit diff
path: root/src/test/codegen
AgeCommit message (Collapse)AuthorLines
2018-07-29dont hardcode vtable size in codegen testRalf Jung-2/+2
2018-07-29update codegen testsRalf Jung-2/+2
2018-07-26Add a test for sparc64 ABI issueSimonas Kazlauskas-0/+36
2018-07-21Only run the test on x86_64Scott McMurray-0/+1
Smaller platforms don't merge the loads the same way.
2018-07-21Don't use SIMD in mem::swap for types smaller than the block sizeScott McMurray-0/+26
LLVM isn't able to remove the alloca for the unaligned block in the SIMD tail in some cases, so doing this helps SRoA work in cases where it currently doesn't. Found in the `replace_with` RFC discussion.
2018-07-13Auto merge of #51622 - kennytm:three-field-range-inclusive, r=SimonSapinbors-0/+74
Change RangeInclusive to a three-field struct. Fix #45222. This PR also reverts #48012 (i.e. removed the `try_fold`/`try_rfold` specialization for `RangeInclusive`) because LLVM no longer has trouble recognizing a RangeInclusive loop.
2018-07-13Change RangeInclusive to a three-field struct.kennytm-0/+74
Fix #45222.
2018-07-13Auto merge of #52046 - cramertj:fix-generator-mir, r=eddybbors-3/+3
Ensure StorageDead is created even if variable initialization fails Rebase and slight cleanup of https://github.com/rust-lang/rust/pull/51109 Fixes https://github.com/rust-lang/rust/issues/49232 r? @eddyb
2018-07-12Ensure StorageDead is created even if variable initialization failsTaylor Cramer-3/+3
2018-07-11Auto merge of #51966 - alexcrichton:llvm7, r=michaelwoeristerbors-20/+26
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-20/+26
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-1/+55
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-09bump llvm version of failing codegen testgnzlbg-0/+1
2018-07-09bump minimum LLVM version to 5.0gnzlbg-12/+1
2018-07-05Update scalar pairs per review commentsJosh Stone-0/+14
2018-07-05Store scalar pair bools as i8 in memoryJosh Stone-1/+41
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-30Do not allow LLVM to increase a TLS's alignment on macOS.kennytm-0/+40
2018-06-17test: Ignore some problematic tests on powerpc and powerpc64*John Paul Adrian Glaubitz-0/+8
2018-06-12Stabilize #[repr(transparent)]Simon Sapin-5/+1
Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318 Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-04test: Ignore some problematic tests on sparc and sparc64John Paul Adrian Glaubitz-0/+8
2018-05-28Auto merge of #50521 - gnzlbg:simd_float, r=alexcrichtonbors-1/+1554
Add simd math intrinsics and gather/scatter This PR adds simd math intrinsics for floating-point vectors (sqrt, sin, cos, pow, exp, log, fma, abs, etc.) and the generic simd gather/scatter intrinsics.
2018-05-24std: Ensure OOM is classified as `nounwind`Alex Crichton-0/+21
OOM can't unwind today, and historically it's been optimized as if it can't unwind. This accidentally regressed with recent changes to the OOM handler, so this commit adds in a codegen test to assert that everything gets optimized away after the OOM function is approrpiately classified as nounwind Closes #50925
2018-05-24enable fast-math flagsgnzlbg-98/+98
2018-05-24add gather/scatter run-time testgnzlbg-0/+3
2018-05-24add run-time test and missing codegen testgnzlbg-0/+104
2018-05-24fix tidygnzlbg-0/+2
2018-05-24add simd float intrinsics and gather/scattergnzlbg-0/+1444
2018-05-24move simd-minmax-test to run-pass; require llvm 7gnzlbg-1/+1
2018-05-19Ensure that statics are always ByRefOliver Schneider-1/+7
2018-05-17Emit noalias on &mut parameters by defaultNikita Popov-6/+4
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-11Introduce ConstValue and use it instead of miri's Value for constant valuesJohn Kåre Alsaker-7/+1
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 :/