Commit Graph

43 Commits

Author SHA1 Message Date
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Dmitri Gribenko
8f7c9ae3fd Collection.sort() => .sorted() 2015-12-18 16:20:01 -08:00
Adrian Prantl
7821341542 Add an argument-number field to DebugValueInst and friends.
This commit adds a DebugVariable field that is shared by
- AllocBoxInst
- AllocStackInst
- DebugValueInst
- DebugValueAddrInst
Currently DebugVariable only holds the Swift argument number.

This allows us to retire several expensive heuristics in IRGen that
attempted to identify which local variables actually where arguments
and recover their relative order.

Memory footprint notes:
This commit adds a 4-byte field to 4 SILInstructin subclasses.
This was offset by 8ab1e2dd50
which removed 20 bytes from *every* SILInstruction.

Caveats:
This commit surfaces a known bug in FunctionSigantureOpts, tracked in
rdar://problem/23727705 — debug info for exploded function arguments
cannot be expressed until this is fixed.

This reapplies ed2b16dc5a with a bugfix for
generic function arrguments and an additional testcase.

<rdar://problem/21185379&22705926>
2015-12-03 13:40:35 -08:00
Adrian Prantl
2740ad6976 Temporarily Revert "Add an argument-number field to DebugValueInst and friends."
while investigating buildbot breakage.

This reverts commit ed2b16dc5a.
2015-12-02 19:10:05 -08:00
Adrian Prantl
ed2b16dc5a Add an argument-number field to DebugValueInst and friends.
This commit adds a DebugVariable field that is shared by
- AllocBoxInst
- AllocStackInst
- DebugValueInst
- DebugValueAddrInst
Currently DebugVariable only holds the Swift argument number.

This allows us to retire several expensive heuristics in IRGen that
attempted to identify which local variables actually where arguments
and recover their relative order.

Memory footprint notes:
This commit adds a 4-byte field to 4 SILInstructin subclasses.
This was offset by 8ab1e2dd50
which removed 20 bytes from *every* SILInstruction.

Caveats:
This commit surfaces a known bug in FunctionSigantureOpts, tracked in
rdar://problem/23727705 — debug info for exploded function arguments
cannot be expressed until this is fixed.

<rdar://problem/21185379&22705926>
2015-12-02 18:33:07 -08:00
Adrian Prantl
ff45147d27 Re-enable this testcase after some minor tweaking.
rdar://problem/22654702

Swift SVN r31894
2015-09-11 16:32:10 +00:00
Michael Gottesman
18e203d168 XFAIL failing debug info test.
rdar://22654702

Swift SVN r31878
2015-09-11 01:11:04 +00:00
Michael Gottesman
6d74962918 Adapt all DebugInfo testcases to the new upstream LLVM metadata format.
Swift SVN r31813
2015-09-09 04:37:34 +00:00
Andrew Trick
2fc2e5096f Reapply "Add initial support for eliminating nontrivial dead objects."
This reverts commits r29171 and r29170, and reintroduces the optimization. It was
reverted out of paranoia and bad timing.

Swift SVN r29179
2015-05-31 01:43:48 +00:00
Andrew Trick
ff82328edc Revert "Add initial support for eliminating nontrivial dead objects."
This reverts commit r29168.

A SourceKit unit test crashed after enabling this (SyntaxMapData/diags.swift).

I can't debug this at the moment because of a broken install, so I'll have to revert.

Swift SVN r29171
2015-05-30 08:18:11 +00:00
Andrew Trick
6200a76db3 Add initial support for eliminating nontrivial dead objects.
This currently handles fixed size dead arrays, which speeds up Richards (and DeadArray)
by 100x:
Fixes <rdar://problem/20980377> Add dead array elimination to DeadObjectElimination

To handle arrays, I added a run of DeadObjectElimination before high
level semantic inlining. This is necessary to recognize array
initialization. Recognizing low-level operations on the array would
require more extensive analysis with interprocedural escape
information.

Arrays are actually the hard case. To handle the general (easy) case,
I just need to add a simple destructor analysis.

This also makes the order that instructions are removed deterministic.

Swift SVN r29168
2015-05-30 05:12:49 +00:00
Erik Eckstein
8aca63b2fc Don't delete debug_value/debug_value_addr in dead code elimination unless their definitions are dead.
And also adapt a whole set of SIL passes so that they can deal with (the not deleted) debug_value instructions.
This was required to prevent perforamnce and code size regressions.
Now the generated code is (almost) the same as before.

The effect of this change is that we keep debug_value/debug_value_addr also in optimized code (more or less).
Fixes rdar://problem/18709125.




Swift SVN r28872
2015-05-21 13:34:47 +00:00
Dmitri Hrybenko
fe239e3d03 stdlib: de-underscore sort() and partition() methods
Swift SVN r28839
2015-05-20 19:34:36 +00:00
Dmitri Hrybenko
8beb642dc9 Remove uses of println() from test/DebugInfo/closure-multivalue.swift
Swift SVN r28037
2015-05-01 09:34:32 +00:00
Dmitri Hrybenko
155fa0a425 Speculatively revert my change to test/DebugInfo/closure-multivalue.swift
Apparently it broke the test when the standard library is built with
debug info.

Swift SVN r28036
2015-05-01 08:47:02 +00:00
Dmitri Hrybenko
0fce5c7b4e tests: remove uses of println() that are not relevant to the tests
Swift SVN r28016
2015-05-01 03:35:50 +00:00
Duncan Exon Smith
c6d42db070 Adapt to MD* => DI* renaming of debug info types
Applied the upgrade script from r236120 (LLVM) and r236121 (CFE).  This is the
final step of rdar://problem/20434113.



Swift SVN r27925
2015-04-29 21:40:21 +00:00
Dmitri Hrybenko
9ed3a4a196 tests: fix a test for 32-bit platforms
Swift SVN r25745
2015-03-04 05:19:21 +00:00
Duncan Exon Smith
093eb3c365 DebugInfo: Hand-update testcases after LLVM r231082
Update debug info testcases after moving the new hierarchy into place in
upstream LLVM r231082.

rdar://problem/19720042



Swift SVN r25715
2015-03-03 19:15:31 +00:00
Adrian Prantl
1d6d890e13 Adapt upstream LLVM API change.
Swift SVN r25109
2015-02-10 00:55:03 +00:00
Adrian Prantl
af349b7548 Re-enable this testcase.
Swift SVN r24909
2015-02-02 23:35:51 +00:00
Dmitri Hrybenko
49ba1c3a39 Revert "Don't hardcode the integer size."
This reverts commit r24887.  The test was failing on 64-bit OS X after
that fix.

Swift SVN r24890
2015-02-02 03:23:40 +00:00
Adrian Prantl
0d2881db78 Don't hardcode the integer size.
Swift SVN r24887
2015-02-01 16:15:12 +00:00
Dmitri Hrybenko
f47ee38fcb Disable the test DebugInfo/closure-multivalue.swift, it has been failing
for a few days already

rdar://19674999

Swift SVN r24878
2015-01-31 10:52:31 +00:00
Adrian Prantl
7fd7d6f25d Tweak testcase to work with release and debug stdlibs.
Swift SVN r24849
2015-01-30 18:17:27 +00:00
Adrian Prantl
88b7262822 Relax testcase.
Swift SVN r24819
2015-01-29 20:02:58 +00:00
Mark Lacey
a842e35810 Reapply "Handle thin_to_thick_function in call graph construction."
Reapply r24765 with small tweak to comment. This was reverted in r24766.

It turns out that this particular change does not interfere with any
assumptions made in the function signature optimization pass.

Swift SVN r24804
2015-01-28 20:21:45 +00:00
Mark Lacey
7ca8777b45 Revert "Handle thin_to_thick_function in call graph construction."
This reverts commit r24765.

There might be an issue with some of the clients of the call graph
making assumptions that this change invalidates.

Swift SVN r24766
2015-01-28 00:51:00 +00:00
Mark Lacey
626082776c Handle thin_to_thick_function in call graph construction.
Swift SVN r24765
2015-01-28 00:37:39 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Adrian Prantl
1229413d96 Massage this testcase so it works with a debug stdlib, too.
Swift SVN r24458
2015-01-15 22:55:26 +00:00
Adrian Prantl
95eec5a155 Fix Test for: DCE is dropping debug intrinsics, Was: DebugInfo/closure-multivalue test is failing
In order to not completely loose testcoverage while rdar://problem/18709125
is under investiagtion, add a special flag for enabling debug value
liveness.

Patch by Michael Gottesman!

<rdar://problem/19267059>

Swift SVN r24416
2015-01-14 18:37:39 +00:00
Graham Batty
83f27a8af7 Revert "Mark tests that don't pass on linux as XFAIL."
This reverts commit 2711ca86de7bf6a7885ccea24219a48a590b1e95.

Swift SVN r23577
2014-11-24 17:42:13 +00:00
Graham Batty
198402dcfe Mark tests that don't pass on linux as XFAIL.
Swift SVN r23573
2014-11-24 17:40:37 +00:00
Adrian Prantl
d238a3f17b Don't emit line numbers for subprograms that are thunks / bare functions.
<rdar://problem/18670152> Stack trace is a lie

Swift SVN r22854
2014-10-20 23:04:06 +00:00
Adrian Prantl
93b864ff31 Temporarily disable one of this tests RUN lines until
<rdar://problem/18709125> DCE is dropping debug intrinsics, Was: DebugInfo/closure-multivalue test is failing
is resolved.

Swift SVN r22845
2014-10-20 18:10:31 +00:00
Adrian Prantl
ac683e8d3d Make this test a bit more deterministic.
<rdar://problem/18559019> DebugInfo/closure-multivalue.swift failing with recent ToT changes

Swift SVN r22590
2014-10-08 00:40:15 +00:00
Adrian Prantl
204e9ee347 Fix testcase for upstream IR printer change
Swift SVN r22484
2014-10-02 23:02:48 +00:00
Adrian Prantl
d769498ccd Update for upstream LLVM API change.
Swift SVN r22456
2014-10-02 01:33:24 +00:00
Adrian Prantl
10d2e7e2c5 Debug info: Emit a more efficient representation for -O0 shadow copies for
explosions by copying them into a single, aggregate alloca.
This also happens to hide <rdar://problem/17815972> for llvm-600.

Swift SVN r20582
2014-07-26 00:18:16 +00:00
Ted Kremenek
d075f06573 Require a minimum deployment target of iOS 7 or OSX 10.9
Implements <rdar://problem/17532113>

Swift SVN r19451
2014-07-02 06:23:38 +00:00
Dave Abrahams
acc2c3be40 [stdlib] Prepare array sort for value semantics
Sorting was a bit of a mess; we had sort functions doing in-place
mutation /and/ returing the value, and people were confused by the
asymmetry of Array's sort() method with other higher-level methods.

Fixes <rdar://problem/17185815> sort([]T, f) mutates the original array
<rdar://problem/17225190> The Array.sort() method should return a sorted array

Swift SVN r18922
2014-06-16 13:48:43 +00:00
Adrian Prantl
c0b5da0d7f [please update LLVM] Debug info: Support multi-valued explosions, e.g.,
tuples and structs that are passed to a function by value.

<rdar://problem/15928331> Need to support DW_OP_piece for multi-Value variables/arguments
<rdar://problem/16599747> Variables not displayed at all in SwiftDemo02b_Closure (back again)

Swift SVN r17923
2014-05-12 03:31:07 +00:00