Commit graph

18571 commits

Author SHA1 Message Date
bors
35655a0fb3 auto merge of #6803 : Thiez/rust/native_fmax_fmin, r=brson
Calls to the libc versions of fmin and fmax were relatively slow (perhaps because they could not be inlined?). This pull request provides f32 and f64 with fmin and fmax written in Rust, and shows a significant speed increase on my system; I used https://github.com/thiez/rustray as my benchmark, with --opt-level 3 it brings the ray-tracing time down from 10.8 seconds to about 9.2, which seemed significant to me.

r?
2013-05-29 13:29:06 -07:00
bors
d2957091c4 auto merge of #6733 : alexcrichton/rust/issue-2400, r=brson
Most of the relevant information can be found in the commit messages.

r? @brson - I just wanted to make sure the make changes aren't completely bogus

This would close #2400, #6517, and #6489 (although a run through incoming-full on linux would have to confirm the latter two)
2013-05-29 12:13:49 -07:00
Matthijs Hofstra
3141acf674 Changed to a more efficient implementation. 2013-05-29 20:21:04 +02:00
bors
562069c12f auto merge of #6800 : june0cho/rust/issue5984, r=pcwalton
Fix #5984.
Resolve the problem which exists in #6780.
2013-05-29 10:55:53 -07:00
Matthijs Hofstra
6cc9a26a2d Replaced calls to external fmin/fmax by a Rust implementation. 2013-05-29 18:26:50 +02:00
bors
a037fa4da3 auto merge of #6796 : sfackler/rust/FromBase64-type-fix, r=bstrie
Previously, FromBase64 was only implemented on ~[u8] and ~str when
any pointer would do. The implementations of FromBase64 are now
consistent with the implementations of ToBase64.
2013-05-29 08:49:53 -07:00
bors
844b5cff36 auto merge of #6794 : thestinger/rust/align_zero, r=pcwalton
This is unlikely to alter optimized codegen much but there's no point in downgrading the known alignment to 1.
2013-05-29 07:32:06 -07:00
James Miller
faf1afee16 Further refactor optimization pass handling
This refactors pass handling to use the argument names, so it can be used
in a similar manner to `opt`. This may be slightly less efficient than the
previous version, but it is much easier to maintain.

It also adds in the ability to specify a custom pipeline on the command
line, this overrides the normal passes, however. This should completely
close #2396.
2013-05-29 20:08:20 +12:00
bors
e3e55c5c04 auto merge of #6793 : graydon/rust/drop-ast-before-llvm, r=Aatch 2013-05-29 00:52:47 -07:00
bors
149960e0cf auto merge of #6789 : luqmana/rust/compiletest-fix, r=thestinger
Can be removed after a snapshot I believe.
2013-05-28 23:34:48 -07:00
june0cho
14d59af0a3 Fix vec::mut_slice 2013-05-29 15:04:34 +09:00
bors
d80642b519 auto merge of #6784 : nikomatsakis/rust/moves-into-borrowck, r=pcwalton
Move the computation of what data is moved out of `liveness` and into `borrowck`. The resulting code is cleaner, since before we had a split distribution of responsibilities, and also this avoids having multiple implementations of the dataflow code. Liveness is still used to report warnings about useless writes. This will go away when we get the control-flow graph code landed (working on that).

Also adds borrow checker documentation.

Fixes #4384.
Required to support once fns and to properly fix closures (#2202).
First step to generalize our treatment of moves somewhat as well.
2013-05-28 22:16:50 -07:00
bors
e946b4fa3f auto merge of #6778 : Aatch/rust/pass-refactor, r=graydon
Refactor the optimization passes to explicitly use the passes. This commit just re-implements the same passes as were already being run.

It also adds an option (behind `-Z`) to run the LLVM lint pass on the unoptimized IR.

This should close #2812. It is also the first step towards #2396

----------------

This is pretty much just an initial "get it out there" PR. With finer control over the optimization passes coming later. I also just blindly copied the passes we were already doing, so there could almost certainly be some more work in paring it down.

The other thing is the addition of the `mergefunctions` pass, which is currently enabled at `--opt-level=3` and does have a small impact on the code size. However the fact that it is at the end of the optimization pipeline is probably not ideal, so some more experimentation is in order.
2013-05-28 21:01:53 -07:00
James Miller
4ad0b8ac58 Remove extraneous defs from export file 2013-05-29 15:15:42 +12:00
bors
e0d6486ed6 auto merge of #6780 : june0cho/rust/issue5984, r=brson
Fix #5984. Also, I found a problem on type inference and left a comment.
2013-05-28 19:58:52 -07:00
Alex Crichton
ba33472f9f Un-ignore rusti/rustpkg tests on i686 2013-05-28 21:23:42 -05:00
Alex Crichton
ff86830c9c Define rustc's host triple at compile time
This way a cross-compiled rustc's answer to host_triple() is correct. The return
value of host_triple() reflects the actual host triple that the compiler was
build for, not the triple the compiler is being built on
2013-05-28 21:23:42 -05:00
James Miller
6861d542a2 Remove now-unused import 2013-05-29 14:16:49 +12:00
James Miller
998e2ce4ff Remove passes that were causing bad optmizations 2013-05-29 14:16:49 +12:00
James Miller
4988c89e86 Move the initial dead prototype removal pass 2013-05-29 14:16:49 +12:00
James Miller
a5b87d71e0 Fix pass creation typo 2013-05-29 14:16:49 +12:00
James Miller
d694e283b3 Refactor optimization pass handling.
Refactor the optimization passes to explicitly use the passes. This commit
just re-implements the same passes as were already being run.

It also adds an option (behind `-Z`) to run the LLVM lint pass on the
unoptimized IR.
2013-05-29 14:16:49 +12:00
Steven Fackler
b1e7d49b11 Generalized implementation of FromBase64
Previously, FromBase64 was only implemented on ~[u8] and ~str when
any pointer would do. The implementations of FromBase64 are now
consistent with the implementations of ToBase64.
2013-05-28 18:41:05 -07:00
bors
c8c60f063f auto merge of #6740 : Aatch/rust/atomic-types, r=brson
This is a follow up to #6732. Makes everything a little more sound.

r? @brson
2013-05-28 18:34:51 -07:00
bors
e3d0c1eb0e auto merge of #6731 : thomaslee/rust/issue-6575, r=pcwalton
Fix for #6575. In the trans phase, rustc emits code for a function parameter that goes completely unused in the event the return type of the function in question happens to be an immediate.

This patch modifies rustc & parts of rustrt to ensure that the vestigial parameter is no longer present in compiled code.
2013-05-28 17:37:57 -07:00
Niko Matsakis
f30b538929 Update documentation for moves 2013-05-28 20:22:15 -04:00
Niko Matsakis
e35db1ab35 Reconcile treatment of &mut with the docs 2013-05-28 20:22:15 -04:00
Niko Matsakis
bf1647c92a Reconcile docs and code, adding examples and adding RESTR_CLAIM 2013-05-28 20:22:15 -04:00
Niko Matsakis
329f7a17e2 Update docs on the formal basis of the borrow checker. 2013-05-28 20:22:15 -04:00
Niko Matsakis
5851d3242c Move checking for moves and initialization of local variables and patterns into
borrow checker and generalize what moves are allowed. Fixes a nasty
bug or two in the pattern move checking code. Unifies dataflow code
used for initialization and other things. First step towards
once fns. Everybody wins.

Fixes #4384. Fixes #4715. cc once fns (#2202), optimizing local moves (#5016).
2013-05-28 20:22:14 -04:00
bors
5676056ae6 auto merge of #6775 : yjh0502/rust/issue_6696, r=catamorphism 2013-05-28 15:40:53 -07:00
Daniel Micay
9ab2921300 use the type's alignment for generated memsets 2013-05-28 18:38:46 -04:00
Graydon Hoare
b4a3fe25c6 librustc: drop AST before running LLVM, frees 400mb on a librustc build 2013-05-28 15:31:32 -07:00
bors
9a06ff0590 auto merge of #6707 : catamorphism/rust/issue-5543, r=catamorphism 2013-05-28 14:35:00 -07:00
Tim Chevalier
7ad1cc71e3 testsuite: Add main function to issue-5554 test 2013-05-28 13:43:10 -07:00
bors
d7e1f08b21 auto merge of #6774 : alexcrichton/rust/silence-warnings, r=graydon
Also as a bonus this fixes #6767
2013-05-28 13:35:05 -07:00
Alex Crichton
b04c40bb1c Silence various warnings throughout test modules 2013-05-28 15:27:35 -05:00
Luqman Aden
c49e41c42f compiletest: Add #[no_core] to fix check-stage1. 2013-05-28 15:58:35 -04:00
bors
833ed21f87 auto merge of #6786 : thestinger/rust/revert-noalias-mut-rptr, r=nikomatsakis
it can alias `&const` and `@mut`
2013-05-28 10:11:05 -07:00
Daniel Micay
accc5272f8 noalias on all &mut parameters is too coarse
it can alias `&const` and `@mut`
2013-05-28 13:05:50 -04:00
Alex Crichton
8749cb59d8 Fix 'make check-stage1-std' by correcting dependencies 2013-05-28 09:37:38 -05:00
bors
05735a934a auto merge of #6783 : hoelzro/rust/master, r=bstrie
I think settings like this should be left up to the user.
2013-05-28 07:16:59 -07:00
Rob Hoelz
2505416408 Remove colorcolumn setting 2013-05-28 16:06:15 +02:00
bors
c33258bee1 auto merge of #6773 : lkuper/rust/alt-to-match, r=thestinger
RIP `alt`.
2013-05-28 05:07:59 -07:00
bors
24784e8030 auto merge of #6771 : thestinger/rust/highlight, r=luqmana
This works with pandoc linked against highlighting-kate >= 0.5.3.8. It seems to just be a no-op with earlier versions, because I successfully ran this through `try`.

This also fixes some consistency issues (like making `Example`/`Examples` always a header and always using three tildes).
2013-05-28 04:02:02 -07:00
bors
b738b5766e auto merge of #6754 : thestinger/rust/noalias, r=nikomatsakis
The compiler guarantees that there are no other references to a unique pointer when it's passed by-value to a function.

The existence of the header and annihilator don't matter since it's not relevant to the call:

> For a call to the parent function, dependencies between memory references from before or after the call and from those during the call are “irrelevant” to the noalias keyword for the arguments and return value used in that call.

@graydon's tracing garbage collector stores the metadata outside of the boxes, so that won't be a problem. I'm unsure if updating the header while inside a function where it's marked as `noalias` would be a problem anyway since you never actually read or write to the header.

@nikomatsakis: r?
2013-05-28 02:59:03 -07:00
bors
7ee329e97a auto merge of #6770 : lkuper/rust/6762, r=catamorphism 2013-05-28 01:50:03 -07:00
bors
fe7f528e5d auto merge of #6769 : catamorphism/rust/issue-4994, r=thestinger
r? @thestinger As called for in #4994
2013-05-28 00:44:05 -07:00
bors
f7f36a8373 auto merge of #6766 : fdr/rust/time-by-value, r=catamorphism
Per the recommendation of the now-removed FIXME.
2013-05-27 23:41:19 -07:00
bors
6264df5331 auto merge of #6777 : alexcrichton/rust/less-memory, r=graydon
Via my super-accurate timing (`/usr/bin/time -l`), I get 2431119360 => 1884430336 == ~520MB

Closes #6637.
2013-05-27 22:29:09 -07:00