Commit Graph

2768 Commits

Author SHA1 Message Date
swift-ci
fe33d12ead Merge remote-tracking branch 'origin/master' into master-next 2018-05-11 16:29:53 -07:00
Doug Gregor
f2279520ed [SIL Optimizer] Eliminate some uses of SubstitutionList for debug output. 2018-05-11 13:18:06 -07:00
Doug Gregor
d457f1c752 [IRGen/SIL] More widespread use of SubstitutionMap. 2018-05-11 13:18:06 -07:00
Doug Gregor
09446defef Eliminate yet more SubstitutionLists from SIL in search of a steady-state 2018-05-11 13:18:06 -07:00
Doug Gregor
4b5abbddbc [SIL] Teach *ApplyInst to traffic in SubstitutionMap.
Push SubstitutionMaps through most of SILGen and the SIL optimizers
that involve the various *ApplyInsts.
2018-05-11 13:18:06 -07:00
swift-ci
375eab7c9f Merge remote-tracking branch 'origin/master' into master-next 2018-05-08 19:49:20 -07:00
Ravi Kandhadai
957dc37615 [Diagnostics & Tests] Add diagnostics for detecting invalid conversions from
floating point literals to integers (<rdar://39730762>).

Add test cases for checking the correctness of the diagnostics.
2018-05-08 15:30:04 -07:00
swift-ci
ad0712c02b Merge remote-tracking branch 'origin/master' into master-next 2018-05-04 08:49:40 -07:00
David Zarzycki
8c0c55539f [SIL] NFC: Rename misleading getSwiftRValueType() to getASTType()
Reference storage types are not RValues. Also, use more SILType helper
methods to avoid line wrap.
2018-05-04 08:14:38 -04:00
swift-ci
5f22c9ceec Merge remote-tracking branch 'origin/master' into master-next 2018-05-03 13:49:29 -07:00
Doug Gregor
b1f338a00b [SIL Opt] Switch GenericSpecializationInformation over to SubstitutionMap.
There isn't a clean cut point here, so switch
GenericSpecializationInformation from SubstitutionList to
SubstitutionMap and carry along dual SubstitutionMap/SubstitutionList
representations for a small part of ReabstractionInfo.
2018-05-03 09:27:21 -07:00
swift-ci
49b2c7fe2a Merge remote-tracking branch 'origin/master' into master-next 2018-05-01 12:08:52 -07:00
Arnold Schwaighofer
678a99e76a Add a copy_block_without_escaping %block withoutEscaping %closure instruction
Mandatory pass will clean it up and replace it by a copy_block and
is_escaping/cond_fail/release combination on the %closure in follow-up
patches.

The instruction marks the dependence of a block on a closure that is
used as an 'withoutActuallyEscaping' sentinel.

rdar://39682865
2018-05-01 07:24:19 -07:00
swift-ci
c12d46675a Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 17:49:07 -07:00
Huon Wilson
978a5c89b1 [SILOptimizer] std::function -> llvm::function_ref for some non-escaping params. 2018-05-01 08:29:07 +10:00
swift-ci
dfd66e7f6f Merge remote-tracking branch 'origin/master' into master-next 2018-04-27 10:08:58 -07:00
Michael Gottesman
ae14c16e53 Merge pull request #16196 from gottesmm/pr-b7bd0c9de669757c7b00339a8f30e79f6ff1e7c2
[func-sig-opts] Add a new mangling for the guaranteed->owned transfor…
2018-04-27 10:01:00 -07:00
swift-ci
b87673dc82 Merge remote-tracking branch 'origin/master' into master-next 2018-04-27 00:29:08 -07:00
Slava Pestov
175b40919f AST: Fewer headers include Expr.h, Module.h, Stmt.h 2018-04-26 22:55:26 -07:00
Michael Gottesman
afc98b34e9 [func-sig-opts] Add a new mangling for the guaranteed->owned transformation.
I followed the example of the owned->guaranteed transformation.

rdar://38196046
2018-04-26 16:36:41 -07:00
swift-ci
31c62d1a52 Merge remote-tracking branch 'origin/master' into master-next 2018-04-25 19:29:17 -07:00
Michael Gottesman
1fdb6ca4ab [func-sig-opts] Make FunctionSignatureOptUtils a library specific header and merge some of it into FunctionSignatureOpts.
This functionality is really specific to FunctionSignatureOpts. It really
doesn't make sense to have it as a utils until it becomes more general or we
need it in multiple places.

NFC.

rdar://38196046
2018-04-25 18:10:30 -07:00
swift-ci
0d3f087c3c Merge remote-tracking branch 'origin/master' into master-next 2018-04-17 06:49:06 -07:00
Andrew Trick
cdcb7c7a2c [NFC] SideEffectAnalysis refactoring and cleanup.
Make this a generic analysis so that it can be used to analyze any
kind of function effect.

FunctionSideEffect becomes a trivial specialization of the analysis.

The immediate need for this is to introduce an new
AccessedStorageAnalysis, although I foresee it as a generally very
useful utility. This way, new kinds of function effects can be
computed without adding any complexity or compile time to
FunctionSideEffects. We have the flexibility of computing different
kinds of function effects at different points in the pipeline.

In the case of AccessedStorageAnalysis, it will compute both
FunctionSideEffects and FunctionAccessedStorage in the same pass by
implementing a simple wrapper on top of FunctionEffects.

This cleanup reflects my feeling that nested classes make the code
extremely unreadable unless they are very small and either private or
only used directly via its parent class. It's easier to see how these
classes compose with a flat type system.

In addition to enabling new kinds of function effects analyses, I
think this makes the implementation of side effect analysis easier to
understand by separating concerns.
2018-04-16 17:05:04 -07:00
swift-ci
491445b075 Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 11:35:46 -07:00
Davide Italiano
b4d563802b [SILInstruction] Introduce isDebugInstruction().
This is a property of an instruction and should be a member
function of `SILInstruction` and not a free function in
`DebugUtils`. Discussed with Adrian.
2018-04-11 10:14:21 -07:00
swift-ci
272cac3586 Merge remote-tracking branch 'origin/master' into master-next 2018-04-07 20:29:42 -07:00
Michael Gottesman
88bc490380 [func-sig-opts] hasNonTrivialNonDebugUse => hasNonTrivialNonDebugTransitiveUsers and move to DebugUtils.
I am getting rid of FunctionSignatureOptUtils. It is only used by
FunctionSignatureOpts, so it should either be a local utility file whose header
lives in ./lib or integrated into FunctionSignatureOpts. Beyond this utility
function (which seems like a generally useful thing that should be in
DebugUtils), the only other thing left in FunctionSignatureOptUtils is part of
the heuristic of FunctionSignatureOpts. It should really be in that file.

rdar://38196046
2018-04-07 10:06:48 -07:00
swift-ci
6c2f4dd034 Merge remote-tracking branch 'origin/master' into master-next 2018-03-30 23:08:53 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
swift-ci
53cb21bb8a Merge remote-tracking branch 'origin/master' into master-next 2018-03-30 20:49:03 -07:00
Michael Gottesman
a00f252ff8 Merge pull request #15646 from gottesmm/pr-3a87b9bc7f815f7952b698d3f63f36dd1fb9bbde
[generic-specializer] Promote non-trivial in_guaranteed => guaranteed.
2018-03-30 20:44:30 -07:00
Michael Gottesman
510381e8ec [generic-specializer] Promote non-trivial in_guaranteed => guaranteed.
We did this for @in => @owned for all parameters before enabling +0. We decided
to defer this work to after +0 was turned back on.

This also fixes the array_contentof_opt test without making append(contentOf: )
take the container at +1.

rdar://38152291
2018-03-30 18:20:35 -07:00
swift-ci
926815f2c1 Merge remote-tracking branch 'origin/master' into master-next 2018-03-29 23:28:57 -07:00
Davide Italiano
4bfab82eda [MandatoryInlining] Set the correct debug scope when creating a strong_release.
<rdar://problem/39022477>
2018-03-29 21:07:48 -07:00
swift-ci
e6d70f352e Merge remote-tracking branch 'origin/master' into master-next 2018-03-27 22:08:57 -07:00
Huon Wilson
c08085f359 [SILOptimizer] Don't optimize casts to protocols with a conditional conformance.
The conformance existing isn't enough to be sure the cast will succeed,
there may be dynamic information, so we just assume they're always
dynamic and always "MaySucceed".

Fixes rdar://problem/38694450.
2018-03-28 14:58:13 +11:00
swift-ci
1d564a640c Merge remote-tracking branch 'origin/master' into master-next 2018-03-26 14:08:37 -07:00
Joe Shajrawi
98ef683ad3 Merge pull request #15517 from shajrawi/expand_all
[SILOptimizer] shouldExpand can't expand address only types
2018-03-26 14:01:12 -07:00
swift-ci
104921675d Merge remote-tracking branch 'origin/master' into master-next 2018-03-26 12:58:42 -07:00
Joe Shajrawi
e0d94d6956 [SILOptimizer] shouldExpand can't expand address only types: fix a bug wherein EnableExpandAll overrode that 2018-03-26 11:11:50 -07:00
swift-ci
e5ee8f31bb Merge remote-tracking branch 'origin/master' into master-next 2018-03-26 11:03:48 -07:00
Michael Gottesman
86bdc0c0a9 [local] Convert llvm::none_of negative condition => llvm::all_of positive condition.
Outside of the actual function in question this is NFC.
2018-03-26 10:46:17 -07:00
Michael Gottesman
9001d1029f [local] Change some for-loops in analyzeStaticInitializer to use llvm::none_of.
Noticed this while trying to understand the code in global opt that uses this. I
also did a little style cleanup in the function.

NFC.
2018-03-24 14:58:20 -07:00
swift-ci
d9d63fd702 Merge remote-tracking branch 'origin/master' into master-next 2018-03-19 23:07:30 -07:00
Michael Gottesman
e567bc9028 [+0-all-args] Enable +0 normal arguments.
rdar://34222540
2018-03-19 20:25:31 -07:00
swift-ci
7fb186fece Merge remote-tracking branch 'origin/master' into master-next 2018-03-11 23:29:00 -07:00
Andrew Trick
9703d56e03 [exclusivity] Remove dead access markers after optimization.
Generalized to handle scope markers which will become common with future
ownership and lifetime dependence markers.
2018-03-11 23:13:30 -07:00
swift-ci
ecd7a48bb2 Merge remote-tracking branch 'origin/master' into master-next 2018-03-09 09:49:07 -08:00
Arnold Schwaighofer
1e4f55de8d Merge pull request #15046 from aschwaighofer/without_actually_escaping_verification
Implement withoutActuallyEscaping verification
2018-03-09 09:34:06 -08:00