summary refs log tree commit diff
path: root/src/test/codegen
AgeCommit message (Collapse)AuthorLines
2017-10-05Auto merge of #44940 - philipc:remap-path, r=michaelwoeristerbors-0/+23
Don't use remapped path when loading modules and include files Fixes bug reported in https://github.com/rust-lang/rust/issues/41555#issuecomment-327866056. cc @michaelwoerister
2017-09-30rustc: Use 16bit c_int for msp430Daniel Klauer-0/+35
Fix regression from c2fe69b9, where main() signature was changed from using 16bit isize to 32bit c_int for argc parameter/result.
2017-09-30Don't use remapped path when loading modules and include filesPhilip Craig-0/+23
2017-09-28test: Check native main() signatureDaniel Klauer-0/+17
2017-09-02add test for not optimized `pow` with constant powerEvgeniy A. Dushistov-0/+23
Closes #34947
2017-08-28std: Mark allocation functions as nounwindAlex Crichton-0/+32
This commit flags all allocation-related functions in liballoc as "this can't unwind" which should largely resolve the size-related issues found on #42808. The documentation on the trait was updated with such a restriction (they can't panic) as well as some other words about the relative instability about implementing a bullet-proof allocator. Closes #42808
2017-08-06Auto merge of #43488 - Florob:repeat-opt, r=arielb1bors-0/+74
Optimize initialization of arrays using repeat expressions This PR was inspired by [this thread](https://www.reddit.com/r/rust/comments/6o8ok9/understanding_rust_performances_a_newbie_question/) on Reddit. It tries to bring array initialization in the same ballpark as `Vec::from_elem()` for unoptimized builds. For optimized builds this should relieve LLVM of having to figure out the construct we generate is in fact a `memset()`. To that end this emits `llvm.memset()` when: * the array is of integer type and all elements are zero (`Vec::from_elem()` also explicitly optimizes for this case) * the array elements are byte sized If the array is zero-sized initialization is omitted entirely.
2017-08-05codegen tests: Check type of `len` argument to `llvm.memset.*` based on the ↵Florian Zeitz-3/+3
exact intrinsic used
2017-07-29std: Mark `Layout::repeat` as `#[inline]`Alex Crichton-0/+21
This fixes an optimization regression by allowing LLVM to see through more functions. Closes #43272
2017-07-26trans: Optimize initialization using repeat expressionsFlorian Zeitz-0/+74
This elides initialization for zero-sized arrays: * for zero-sized elements we previously emitted an empty loop * for arrays with a length of zero we previously emitted a loop with zero iterations This emits llvm.memset() instead of a loop over each element when: * all elements are zero integers * elements are byte sized
2017-07-24Add a disabled builder for aarch64 emulated testsAlex Crichton-0/+1
This commit adds a disabled builder which will run all tests for the standard library for aarch64 in a QEMU instance. Once we get enough capacity to run this on Travis this can be used to boost our platform coverage of AArch64
2017-07-23Auto merge of #43387 - TimNN:rustllvm50, r=alexcrichtonbors-8/+8
Update Rust LLVM bindings for LLVM 5.0 This is the initial set of changes to update the rust llvm bindings for 5.0. The llvm commits necessitating these changes are linked from the tracking issue, #43370.
2017-07-21Relax a codegen test to be compatible with LLVM 5.0Alex Crichton-8/+8
2017-07-21Ignore stack probe tests on AArch64Mátyás Mustoha-0/+1
2017-07-18powerpc: Ignore the stack-probes testLuca Barbato-0/+1
2017-07-12[LLVM] Avoid losing the !nonnull attribute in SROAAriel Ben-Yehuda-0/+36
This still does not work on 32-bit archs because of an LLVM limitation, but this is only an optimization, so let's push it on 64-bit only for now. Fixes #37945
2017-07-06rustc: Implement stack probes for x86Alex Crichton-0/+24
This commit implements stack probes on x86/x86_64 using the freshly landed support upstream in LLVM. The purpose of stack probes here are to guarantee a segfault on stack overflow rather than having a chance of running over the guard page already present on all threads by accident. At this time there's no support for any other architecture because LLVM itself does not have support for other architectures.
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-1/+1
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-06-19Auto merge of #39409 - pnkfelix:mir-borrowck2, r=nikomatsakisbors-1/+1
MIR EndRegion Statements (was MIR dataflow for Borrows) This PR adds an `EndRegion` statement to MIR (where the `EndRegion` statement is what terminates a borrow). An earlier version of the PR implemented a dataflow analysis on borrow expressions, but I am now factoring that into a follow-up PR so that reviewing this one is easier. (And also because there are some revisions I want to make to that dataflow code, but I want this PR to get out of WIP status...) This is a baby step towards MIR borrowck. I just want to get the review process going while I independently work on the remaining steps.
2017-06-15Add a no-system-llvm compilecheck headerSimonas Kazlauskas-9/+3
2017-06-12Update test/codegen/drop.rs to reflect inconsequential change in basic block ↵Felix S. Klock II-1/+1
ordering.
2017-06-08Upgrade LLVMSimonas Kazlauskas-0/+28
Includes https://github.com/rust-lang/llvm/pull/80 Includes https://github.com/rust-lang/llvm/pull/79 Also adds tests and thus fixes #24194
2017-06-06rustc_trans: do not store pair fields if they are ZSTs.Eduard-Mihai Burtescu-4/+6
2017-06-02compiletest: Force directive to be first complete word in header comment.kennytm-1/+1
Refactored some related code to take advantage of this change.
2017-06-01Adding support for the llvm `prefetch` intrinsicFalco Hirschenberger-0/+75
Related to #37251
2017-05-01Add simple `[repr(align)]` codegen test.Cameron Hart-0/+57
Checks alloca and memcpy are aligned correctly.
2017-04-28Disable path remapping test on Windows.Michael Woerister-0/+1
2017-04-26Make codegen test for remap-path-prefix more thorough.Michael Woerister-5/+34
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-0/+19
reproducible builds.
2017-04-22remove cleanup branches to the resume blockAriel Ben-Yehuda-1/+2
This improves LLVM performance by 10% lost during the shimmir transition.
2017-04-18lower `move_val_init` during MIR constructionAriel Ben-Yehuda-0/+29
Because of its "magic" order-of-evaluation semantics, `move_val_init` must be lowered during MIR construction in order to work.
2017-04-14Rollup merge of #40702 - mrhota:global_asm, r=nagisaCorey Farwell-0/+234
Implement global_asm!() (RFC 1548) This is a first attempt. ~~One (potential) problem I haven't solved is how to handle multiple usages of `global_asm!` in a module/crate. It looks like `LLVMSetModuleInlineAsm` overwrites module asm, and `LLVMAppendModuleInlineAsm` is not provided in LLVM C headers 😦~~ I can provide more detail as needed, but honestly, there's not a lot going on here. r? @eddyb CC @Amanieu @jackpot51 Tracking issue: #35119
2017-04-12Add global_asm testsA.J. Gardner-0/+234
2017-04-12rustc_trans: avoid a separate entry BB if START_BLOCK has no backedges.Eduard-Mihai Burtescu-10/+37
2017-04-09rustc_trans: use ty::layout for ABI computation instead of LLVM types.Eduard-Mihai Burtescu-2/+2
2017-03-31Ignore tests for the personality slot lifetimes on MSVCBjörn Steinbrink-0/+2
Exception handling on MSVC targets doesn't use personality slots.
2017-03-29Emit proper lifetime start intrinsics for personality slotsBjörn Steinbrink-0/+39
We currently only emit a single call to the lifetime start intrinsic for the personality slot alloca. This happens because we create that call at the time that we create the alloca, instead of creating it each time we start using it. Because LLVM usually removes the alloca before the lifetime intrinsics are even considered, this didn't cause any problems yet, but we should fix this anyway.
2017-03-21rustc: Always emit the `uwtable` attribute on WindowsAlex Crichton-0/+41
This commit alters the translation layer to unconditionally emit the `uwtable` LLVM attribute on Windows regardless of the `no_landing_pads` setting. Previously I believe we omitted this attribute as an optimization when the `-Cpanic=abort` flag was passed, but this unfortunately caused problems for Gecko. It [was discovered] that there was trouble unwinding through Rust functions due to foreign exceptions such as illegal instructions or otherwise in-practice methods used to abort a process. In testing it looked like the major difference between a working binary and a non-working binary is indeed this `uwtable` attribute, but this PR has unfortunately not been thoroughly tested in terms of compiling Gecko with `-C panic=abort` *and* this PR to see whether it works, so this is still somewhat working on just suspicion. [was discovered]: https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
2017-03-13emit !align attributes on stores of operand pairsAriel Ben-Yehuda-0/+33
cc #40373
2017-03-07Add tests for issues with the 'E-needtest' label.topecongiro-0/+39
2017-03-03Auto merge of #40133 - arielb1:operand-lifetimes, r=eddybbors-5/+3
[MIR] improve operand lifetimes r? @eddyb
2017-03-03fix codegen testAriel Ben-Yehuda-5/+3
2017-03-02Add support for x86-interrupt calling conventionPhilipp Oppermann-0/+28
Tracking issue: https://github.com/rust-lang/rust/issues/40180 This calling convention can be used for definining interrupt handlers on 32-bit and 64-bit x86 targets. The compiler then uses `iret` instead of `ret` for returning and ensures that all registers are restored to their original values. Usage: ``` extern "x86-interrupt" fn handler(stack_frame: &ExceptionStackFrame) {…} ``` for interrupts and exceptions without error code and ``` extern "x86-interrupt" fn page_fault_handler(stack_frame: &ExceptionStackFrame, error_code: u64) {…} ``` for exceptions that push an error code (e.g., page faults or general protection faults). The programmer must ensure that the correct version is used for each interrupt. For more details see the [LLVM PR][1] and the corresponding [proposal][2]. [1]: https://reviews.llvm.org/D15567 [2]: http://lists.llvm.org/pipermail/cfe-dev/2015-September/045171.html
2017-02-22Update codegen test with new attributesJames Miller-2/+2
2017-02-10Rebase fixupsSimonas Kazlauskas-1/+1
2017-02-10Fix codegen testSimonas Kazlauskas-3/+7
2017-02-09Auto merge of #38109 - tromey:main-subprogram, r=michaelwoeristerbors-0/+56
Emit DW_AT_main_subprogram This changes rustc to emit DW_AT_main_subprogram on the "main" program. This lets gdb suitably stop at the user's main in response to "start" (rather than the library's main, which is what happens currently). Fixes #32620 r? michaelwoerister
2017-02-08emit "align 1" metadata on loads/stores of packed structsAriel Ben-Yehuda-0/+29
According to the LLVM reference: > A value of 0 or an omitted align argument means that the operation has the ABI alignment for the target. So loads/stores of fields of packed structs need to have their align set to 1. Implement that by tracking the alignment of `LvalueRef`s. Fixes #39376.
2017-02-04Emit DW_AT_main_subprogramTom Tromey-0/+56
This changes rustc to emit DW_AT_main_subprogram on the "main" program. This lets gdb suitably stop at the user's main in response to "start" (rather than the library's main, which is what happens currently). Fixes #32620 r? michaelwoerister
2017-01-19travis: Get an emscripten builder onlineAlex Crichton-0/+1
This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling