Commit Graph

823 Commits

Author SHA1 Message Date
David Zarzycki
1cd19eae36 [SIL] NFC: Repack misc PointerToAddressInst bits 2017-12-17 20:58:45 -05:00
David Zarzycki
315cf677dd [SIL] NFC: Repack misc SwitchValueInst bits 2017-12-17 20:54:01 -05:00
David Zarzycki
5443923a0c [SIL] NFC: Repack misc SwitchEnumInstBase bits 2017-12-17 20:24:14 -05:00
David Zarzycki
f0bd535261 [SIL] NFC: Repack misc TupleElementAddrInst bits 2017-12-17 19:58:24 -05:00
David Zarzycki
cf443ecfcf [SIL] NFC: Repack misc TupleExtractInst bits 2017-12-17 19:55:17 -05:00
David Zarzycki
b885daf032 [SIL] NFC: Repack misc WitnessMethodInst bits 2017-12-17 19:49:37 -05:00
David Zarzycki
224b8495bc [SIL] NFC: Repack misc DeallocRefInst bits 2017-12-16 19:26:40 -05:00
David Zarzycki
83546faec8 [SIL] NFC: Repack misc IntegerLiteralInst and FloatLiteralInst bits 2017-12-16 19:12:01 -05:00
David Zarzycki
aef2e8c662 [SIL] NFC: Repack misc LoadInst bits 2017-12-16 18:53:08 -05:00
David Zarzycki
c4e90d6e4f [SIL] NFC: Repack misc StoreInst bits 2017-12-16 18:41:14 -05:00
David Zarzycki
c8a458ed1d [SIL] NFC: Repack misc CopyAddrInst bits 2017-12-16 18:31:46 -05:00
David Zarzycki
b5424c0c17 [SIL] NFC: Repack misc StrongPinInst bits 2017-12-16 18:22:52 -05:00
David Zarzycki
edcb0114c4 [SIL] NFC: Repack misc LoadReferenceInstBase bits 2017-12-16 18:04:49 -05:00
David Zarzycki
f6957eade8 [SIL] NFC: Repack misc StoreReferenceInstBase bits 2017-12-16 18:00:08 -05:00
David Zarzycki
a0a5ca5f14 [SIL] NFC: Repack misc RefCountingInst bits 2017-12-16 17:43:31 -05:00
David Zarzycki
7740d4d05d [SIL] NFC: Repack misc UncheckedOwnershipConversionInst bits 2017-12-16 17:35:27 -05:00
David Zarzycki
c68d481d28 [SIL] NFC: Repack misc UnaryInstructionWithTypeDependentOperandsBase bits 2017-12-16 17:05:00 -05:00
David Zarzycki
f0d0c18be6 [SIL] NFC: Repack misc AllocRefInstBase bits 2017-12-16 11:53:29 -05:00
David Zarzycki
d197894a9d [SIL] NFC: Repack misc AllocStackInst bits 2017-12-16 11:38:43 -05:00
David Zarzycki
54ea315586 [Basic] NFC: Stop using transparent unions 2017-12-16 10:43:49 -05:00
David Zarzycki
7368cc9a8b [SIL] NFC: Convert SILNode to new inline bitfield macros 2017-12-16 09:31:21 -05:00
swift-ci
97ae383e6b Merge remote-tracking branch 'origin/master' into master-next 2017-11-30 13:50:20 -08:00
Jordan Rose
8f8f00012a Merge pull request #12834 from jrose-apple/restrict-cross-module-struct-initializers-2
Implementation of SE-0189 "Restrict cross-module struct initializers to be delegating"

rdar://problem/34777878
2017-11-30 13:32:45 -08:00
swift-ci
17dce98db7 Merge remote-tracking branch 'origin/master' into master-next 2017-11-29 17:30:29 -08:00
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
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
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
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
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
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
John McCall
14d6390352 Add "yield" and "unwind" instructions to SIL. 2017-11-07 03:51:54 -05:00
Michael Gottesman
6c10f911c0 [di] When scalarizing tuples in DI use destructure_tuple.
Bug noticed on inspection.

rdar://31521023
2017-11-05 00:10:15 -05:00
Arnold Schwaighofer
b5fab6145f SILCombiner: Fix partial_apply optimization of @callee_guaranteed
closures

@callee_guaranteed closure contexts must not be released when replacing
a closure application.

SR-5441
rdar://33255593
2017-11-04 14:03:56 -07:00
Michael Gottesman
333f231bea [sil] Change some methods on SingleValueInstruction to use redeclarations instead of using directives.
lldb is not aware of using directives currently so if you try to invoke the
given methods you will get an ambiguous name lookup error from lldb. These are
important methods for debugging in lldb, so instead in this commit we just
redeclare them and delegate to the appropriate parent class.
2017-10-29 12:19:25 -07:00
Michael Gottesman
fa4873ae74 [ome] Teach the eliminator how to lower destructure_{struct,tuple}.
I am doing this to ensure that parts of the optimizer that have not yet been
updated for such operations do not see said instructions. This will ensure no
surprise perf regressions from this work.

rdar://31521023
2017-10-25 19:21:24 -07:00
Michael Gottesman
4c80c4d66f Address John's feedback.
Specifically to commits:

36a8d0d5c0
6df5462ee2

rdar://31521023
2017-10-25 13:48:51 -07:00
Michael Gottesman
36a8d0d5c0 [sil] Add support for the destructure_{struct,tuple} instructions.
rdar://31521023
2017-10-24 18:36:37 -07:00
Michael Gottesman
6df5462ee2 [sil] Add support for multiple value instructions by adding MultipleValueInstruction{,Result}.
rdar://31521023
2017-10-24 18:36:37 -07:00
Slava Pestov
0acf3ac8d9 SIL: Remove is_nonnull instruction 2017-10-13 17:38:32 -07:00
Michael Gottesman
267d63e085 [sil] Instead of returning an ArrayRef<SILValue> for SILInstruction::getResults(), use SILInstructionResultArray.
The reason that I am doing this is in preparation for adding support for
MultipleValueInstruction. This enables us to avoid type issues and also ensures
that we do not increase the size of SingleValueInstruction while we are doing
it.

The MultipleValueInstruction commit will come soon.

rdar://31521023
2017-10-12 18:30:05 -07:00
Slava Pestov
e806b6248d SIL: Remove dynamic_method instruction 2017-10-04 03:53:16 -07:00
Slava Pestov
aea309d43c SIL: Move a comment 2017-10-04 03:53:15 -07:00
Slava Pestov
42a4f1d0a8 SIL: Allow objc_method instruction to have type-dependent operands
This will allow us to remove dynamic_method, emitting objc_method
in its place. It will also allow objc_method to be used for
Objective-C protocol method calls, with witness_method used
for Swift native protocol method calls only.
2017-10-04 03:53:15 -07:00
Slava Pestov
7bf3b90b62 SIL: Split off objc_method / objc_super_method from class_method / super_method
This replaces the '[volatile]' flag. Now, class_method and
super_method are only used for vtable dispatch.

The witness_method instruction is still overloaded for use
with both ObjC protocol requirements and Swift protocol
requirements; the next step is to make it only mean the
latter, also using objc_method for ObjC protocol calls.
2017-10-03 22:13:31 -07:00