Commit Graph

2543 Commits

Author SHA1 Message Date
Slava Pestov
1f79af7504 SIL: Use objc_method instruction for Objective-C protocol method calls
Fixes <rdar://problem/15933365>.
2017-11-29 16:26:43 -08:00
swift-ci
516b6200ce Merge remote-tracking branch 'origin/master' into master-next 2017-11-29 12:29:54 -08:00
Arnold Schwaighofer
ea9907ae15 Revert "SIL: Use objc_method instruction for Objective-C protocol method calls" 2017-11-29 11:19:46 -08:00
swift-ci
3b7e0d5de0 Merge remote-tracking branch 'origin/master' into master-next 2017-11-29 02:32:33 -08:00
Slava Pestov
1ee0970934 SIL: Use objc_method instruction for Objective-C protocol method calls
Fixes <rdar://problem/15933365>.
2017-11-29 01:22:05 -08:00
swift-ci
3971dd2e2a Merge remote-tracking branch 'origin/master' into master-next 2017-11-27 12:09:25 -08:00
Arnold Schwaighofer
3e04f21a41 SIL: Remove EnableGuaranteedClosureContext now that it is the default 2017-11-27 07:25:03 -08:00
swift-ci
5e7945ca0e Merge remote-tracking branch 'origin/master' into master-next 2017-11-19 21:09:01 -08:00
Michael Gottesman
8f5a4859f2 [sil] Add some more utilities for working with destructure operations.
Just slicing off some code from my pred-memopts patch since Slava needs this
functionality for some other work he is doing.
2017-11-19 17:24:33 -08:00
swift-ci
4c0b4ef048 Merge remote-tracking branch 'origin/master' into master-next 2017-11-19 15:28:55 -08:00
Michael Gottesman
a8b1917512 [all-+0] Add a new convention for setters: DefaultSetterConventions.
In a situation where normal arguments are +0, we want setters to still take
normal parameters at +1 since in most cases setters will be taking a parameter
that is being forwarded into to be store into a field.

Since this doesn't actually change the current ParameterConvention for setter
normal arguments, this is NFC.

rdar://34222540
2017-11-19 12:35:18 -08:00
swift-ci
e5967dcbab Merge remote-tracking branch 'origin/master' into master-next 2017-11-17 15:29:02 -08:00
Adam Nemet
fb008462a5 Fix no-assert build after PR12933 2017-11-17 12:22:12 -08:00
swift-ci
07e6dd0229 Merge remote-tracking branch 'origin/master' into master-next 2017-11-17 10:09:02 -08:00
swift-ci
012cc4a6e7 Merge pull request #12933 from anemet/opt-remark-generic-specialization 2017-11-17 10:05:22 -08:00
Adam Nemet
bd8764caaa Add opt remarks to Generic Specializer pass
Adds a combined API to output both debug message and optimization remarks.

The previously added test partial_specialization_debug.sil ensures that it's an
NFC for debug output.
2017-11-16 10:10:24 -08:00
swift-ci
29c42a4633 Merge remote-tracking branch 'origin/master' into master-next 2017-11-16 00:09:16 -08:00
Slava Pestov
cce30cc9bb SIL: Remove SILFunction::mapTypeOutOfContext() 2017-11-15 22:52:28 -08:00
Bob Wilson
92d9a35d40 Merge pull request #12961 from bob-wilson/rdar35514140
master-next: fix build for mapped_iterator change in LLVM r317902
2017-11-15 22:48:48 -08:00
Bob Wilson
6de5c01d83 master-next: fix build for mapped_iterator change in LLVM r317902
The default template parameter assumes that the iterator type is a pointer,
which it is not for SILInstructionResultArray. Just specify the return
type directly instead of using the default.
2017-11-15 22:44:09 -08:00
swift-ci
d3b8ffc42a Merge remote-tracking branch 'origin/master' into master-next 2017-11-14 12:09:04 -08:00
swift-ci
fbaf590bb5 Merge remote-tracking branch 'origin/master' into master-next 2017-11-14 11:29:26 -08:00
Erik Eckstein
90c21be191 Unify the implementation of optimization mode in various option classes.
This commit is mostly refactoring.

*) Introduce a new OptimizationMode enum and use that in SILOptions and IRGenOptions
*) Allow the optimization mode also be specified for specific SILFunctions. This is not used in this commit yet and thus still a NFC.

Also, fixes a minor bug: we didn’t run mandatory IRGen passes for functions with @_semantics("optimize.sil.never")
2017-11-14 11:25:02 -08:00
swift-ci
d1f6107bbc Merge pull request #12924 from gottesmm/pr-2103183ed8106e85e0948acf6949f64bf51946b2 2017-11-14 11:16:50 -08:00
swift-ci
17687fb569 Merge remote-tracking branch 'origin/master' into master-next 2017-11-14 11:09:30 -08:00
swift-ci
1af18d84c1 Merge pull request #12923 from gottesmm/pr-6c446d1f42da1561151e296c5d3510a68baad584 2017-11-14 11:05:14 -08:00
swift-ci
4dc162fafa Merge remote-tracking branch 'origin/master' into master-next 2017-11-14 10:49:05 -08:00
Michael Gottesman
3226921b70 [sil] Add reverse iterator and reverse range support to SILInstructionResultArray.
I also used this as an opportunity to make SILInstructionResultArray::iterator
not inherit from std::iterator given that std::iterator is now deprecated.

Just slicing code off a larger commit.

rdar://31521023
2017-11-14 09:55:12 -08:00
Michael Gottesman
ac8aa12486 [sil-builder] Add utility method emitDestructureValueOperation.
This just abstracts the creation of a destructure_store or destructure_tuple
without the caller needing to know.

Just slicing simple code off of a larger commit.

rdar://31521023
2017-11-14 09:54:34 -08:00
Michael Gottesman
4a263cfcc8 Clean up TypeLowering a bit. I did this while doing some exploratory work. No point in just losing it. 2017-11-14 09:49:05 -08:00
swift-ci
90cc83fabc Merge remote-tracking branch 'origin/master' into master-next 2017-11-13 02:09:19 -08:00
John McCall
045998544f Add begin_apply, abort_apply, and end_apply instructions to allow
yield_once coroutines to be executed.
2017-11-13 04:03:54 -05:00
John McCall
aff457381c Change ApplyInstBase to not try to handle trailing objects itself. NFC.
The goal is to make it more composable to add trailing-objects fields in
a subclass.

While I was doing this, I noticed that the apply instructions provided
redundant getNumArguments() and getNumCallArguments() accessors, so I
went ahead and unified them.
2017-11-13 04:03:21 -05:00
John McCall
7743be30f6 Add a "token" type to SIL to allow dependencies to be expressed without
allowing abstraction.
2017-11-13 04:03:21 -05:00
swift-ci
eb1ec77222 Merge remote-tracking branch 'origin/master' into master-next 2017-11-12 07:09:35 -08:00
Arnold Schwaighofer
fe4d4df508 Merge pull request #12863 from aschwaighofer/sil_and_siloptimizer_callee_guaranteed_fix
SILCombine and SIL adjustFunctionType fix for @callee_guaranteed
2017-11-12 07:05:20 -08:00
swift-ci
ed93aae51b Merge remote-tracking branch 'origin/master' into master-next 2017-11-11 17:09:31 -08:00
Slava Pestov
78ad6c4577 AST: New mangling for method dispatch thunks 2017-11-11 16:31:53 -08:00
swift-ci
9310839cc6 Merge remote-tracking branch 'origin/master' into master-next 2017-11-11 16:09:37 -08:00
Slava Pestov
55e8ac23e2 Merge pull request #12874 from slavapestov/dynamic-required-inits-still-have-allocating-entry-point-in-vtable
SILGen: Fix bug with vtable entries for allocating initializers
2017-11-11 16:09:30 -08:00
swift-ci
fd250b830d Merge remote-tracking branch 'origin/master' into master-next 2017-11-11 12:09:35 -08:00
swift-ci
dc40ef17af Merge pull request #12877 from gottesmm/pr-2825f88a344991e66817bd6fda9868fee5b09a15 2017-11-11 12:03:42 -08:00
Michael Gottesman
2f1ebf3c51 [pred-memopt] Provide normal succ manipulation methods on TermInst instead of SILBasicBlock.
I am doing this for a few different reasons:

1. The code for manipulating successors was partially in TermInst (with
SILBasicBlock delegating to TermInst) and partly in SILBasicBlock itself. It
makes more sense to just be consistent and move all said functionality into
TermInst and just always delegate to SILBasicBlock.

2. I am preparing an API around gathering all critical edges. All of the
critical edge breaking APIs to take a TermInst. I wanted to use some of the
successor APIs, only to discover that we were not delegating to TermInst.  By
moving said functionality onto TermInst itself and delegating, we have it in
both places.

rdar://31521023
2017-11-11 11:27:42 -08:00
Slava Pestov
ce2a434587 SILGen: Fix bug with vtable entries for allocating initializers
Some changes I was working on uncovered a latent bug where we would
emit a class_method instruction to call an allocating initializer
that did not have a vtable entry.

Previously this wasn't caught because the only example of this in
our test suite was in test/SILGen/objc_bridging_any.swift, which
did not test with IRGen; if it did, an IRGen crash would have been
observed.

Factor out some code duplication to prevent this from happening
again, and add a SILGen test that we emit a vtable entry in this
case, and that the test case passes IRGen also.
2017-11-11 02:01:50 -08:00
swift-ci
679f6c06de Merge remote-tracking branch 'origin/master' into master-next 2017-11-10 18:29:37 -08:00
Slava Pestov
773e6bff56 SIL: Add SILFunction::getResilienceExpansion() 2017-11-10 16:20:09 -08:00
Arnold Schwaighofer
68d0a8774a SIL: Make adjustFunction type of closures parameterized on whether we use
guaranteed closures

This is going to go away once we change the default to guaranteed
closures.

SR-5441
rdar://33255593
2017-11-10 15:18:01 -08:00
swift-ci
71fc455b8d Merge remote-tracking branch 'origin/master' into master-next 2017-11-10 14:09:31 -08:00
Jordan Rose
1598a21e43 DI: Warn on non-delegating cross-module struct initializers
...as detected by initializing an individual field without having
initialized the whole object (via `self = value`).

This only applies in pre-Swift-5 mode because the next commit will
treat all cross-module struct initializers as delegating in Swift 5.
2017-11-09 11:24:28 -08:00
Huon Wilson
99c4cddfca [SILGen] Store conditional conformances in SILWitnessTables. 2017-11-08 17:02:50 -08:00