Commit Graph

16 Commits

Author SHA1 Message Date
Chris Lattner
f603333dad split test in half.
Swift SVN r2563
2012-08-06 15:47:43 +00:00
Chris Lattner
461bf7bf99 beef up the testcase to show a trivial dtor being analyzed. This is the dtor from
maxtest in rdar://11542743 that is destroying the varargs array that is implicitly
allocated.



Swift SVN r2561
2012-08-05 23:50:10 +00:00
Chris Lattner
3139f3dcc5 Reenable the "store only object elimination" optimization, with a *very* simple
metric to decide whether a dtor is side-effect free.  This will be improved later
(to make it more aggressive), but is enough to get us to optimize away maxtest
from rdar://11542743 again, thus resolving rdar://11939216



Swift SVN r2559
2012-08-05 17:50:31 +00:00
Eli Friedman
577347d7f8 Fix test I forgot to change along with r2410.
Swift SVN r2415
2012-07-23 21:48:04 +00:00
Chris Lattner
fe24ea3c8f delete some pointless objc_retain/objc_release pairs, which show up in String -> NSString conversions.
Finishes off rdar://11583269


Swift SVN r2127
2012-06-03 04:41:00 +00:00
Chris Lattner
5074859478 teach the optimizer about objc_retain and objc_release, allowing us to zap a objc_release(null)
from the String->NSString conversion routine (rdar://11583269)


Swift SVN r2126
2012-06-03 04:33:21 +00:00
Chris Lattner
540b7b92e6 implement trivial retain motion, pushing retains past operations that obviously cannot release an object (unless we get to a matching retain of course).
This allows us to optimize away 43 (instead of 31) retain/release pairs from the stdlib.  This resolves rdar://11571612.


Swift SVN r2123
2012-06-03 00:53:18 +00:00
Chris Lattner
0412f9e41d split expand and optimize tests into their own files.
Swift SVN r2115
2012-06-02 16:52:01 +00:00
Chris Lattner
32f529f1db Split arc-optimizer into two passes: arc-optimize and arc-expand.
This makes the two phases independently testable, but is also the
right thing to do: previously we'd form swift_retain early enough
that inlining would inline them from previously optimized callees
into callers, and this would block some mid-level optimizations
from doing nice things (because swift_retain isn't no-escape).

It's a small thing, but doing this allows us to eliminate a few 
more "and x, 9223372036854775807"'s from the stdlib.  We also
end up doing a lot less optimizations because we do them early
instead of only having the optimizations exposed after inlining
deeply.



Swift SVN r2114
2012-06-02 16:43:51 +00:00
Chris Lattner
a7f2593b51 make sure to set the tail marker on the generated calls.
Swift SVN r2103
2012-05-31 23:21:47 +00:00
Chris Lattner
91a80673b7 Enhance the swift_retainAndReturnThree optimizer to be able to handle the case
when swift_retainAndReturnThree is inlined from a previously optimized function.

The upshot of this is that we compile:

var a : String
func f() -> String {
  return a
}

into:

__T1t3fooFT_NSs6String:
	pushq	%rax
	movq	__T1t1xNSs6String+16(%rip), %rcx
	movq	__T1t1xNSs6String+8(%rip), %rdx
	movq	__T1t1xNSs6String(%rip), %rsi
	movq	%rcx, %rdi
	callq	_swift_retainAndReturnThree
	popq	%rsi
	ret

instead of:

__T1t3fooFT_NSs6String:
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	movq	__T1t1aNSs6String+8(%rip), %r14
	movq	__T1t1aNSs6String(%rip), %rbx
	movq	__T1t1aNSs6String+16(%rip), %rdi
	callq	_swift_retain
	movq	%rax, %rcx
	movq	%rbx, %rax
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	ret



Swift SVN r2102
2012-05-31 22:57:10 +00:00
Chris Lattner
eef9e914fc tidy up.
Swift SVN r2097
2012-05-31 18:46:26 +00:00
Chris Lattner
44e11311f3 form calls to swift_retainAndReturnThree to improve epilog code when returning
string/array slices.  There is more to be done here, but this is enough to get 
the basic example in rdar://11563395.


Swift SVN r2095
2012-05-31 18:01:19 +00:00
Chris Lattner
64ff644d20 add some check lines I forgot.
Swift SVN r2080
2012-05-30 20:58:52 +00:00
Chris Lattner
9d7eac2e80 a testcase from 11542743
Swift SVN r2077
2012-05-30 20:35:14 +00:00
Chris Lattner
c4acd340b6 Add a basic arc-optimize testcase.
Swift SVN r2076
2012-05-30 20:32:27 +00:00