Michael Gottesman
bd225f9fc4
[capture-promotion] Update capture-promotion for semantic-sil.
...
rdar://29870610
2017-04-02 11:44:14 -07:00
practicalswift
00ba5dc248
[gardening] Fix typos
2017-04-02 16:23:45 +02:00
Slava Pestov
289428ca55
SILOptimizer: Always use Shared linkage for specializations of serialized things
...
With -sil-serialize-all, we might deserialize and specialize
a private function from multiple TUs which are then linked
together.
Since private symbols have unique mangling, this is fine.
It's hard to make a test for this since it only happens with
-sil-serialize-all, which I'd like to kill soon anyway.
2017-03-31 20:26:26 -07:00
Erik Eckstein
c41de405c4
fix a wrong assert in StackNesting
2017-03-30 09:33:00 -07:00
Slava Pestov
695a8d2065
Merge pull request #8407 from slavapestov/rename-everything-without-asking-permission
...
SIL: Terminology change: [fragile] => [serialized]
2017-03-29 20:08:15 -07:00
Slava Pestov
8fe8b89b0f
SIL: Terminology change: [fragile] => [serialized]
...
Also, add a third [serializable] state for functions whose bodies we
*can* serialize, but only do so if they're referenced from another
serialized function.
This will be used for bodies synthesized for imported definitions,
such as init(rawValue:), etc, and various thunks, but for now this
change is NFC.
2017-03-29 16:47:28 -07:00
Erik Eckstein
607318e0c7
Utility for correcting the nesting of stack allocation/deallocation instructions in SIL.
...
This is useful for optimizations (like AllocBoxToStack) which create (de-)alloc_stack instructions.
They can just insert the new instructions anywhere without worrying about nesting and correct the nesting afterwards.
2017-03-29 15:41:04 -07:00
Roman Levenstein
a05cc2c8b5
Enable simple version of partial specialization by default
...
The simple version does not allow for partial specialization of generic parameters whose replacement types in a substitution are generic.
2017-03-28 15:56:40 -07:00
John McCall
57ecaa7fae
Add begin_access and end_access instructions.
...
NFC because we're not actually emitting them.
2017-03-26 04:37:05 -04:00
Roman Levenstein
8082e820c9
[sil-optimizer] Make compile time concatenation of constant strings work again
...
This guaranteed optimization got lost when a + operator for Strings was made a static method on type String.
Fixes SR-4348
2017-03-24 15:55:50 -07:00
Saleem Abdulrasool
092650cad6
Merge pull request #8276 from compnerd/vars
...
SILOptimizer: remove unused variable
2017-03-23 19:16:37 -07:00
Saleem Abdulrasool
8669365feb
SILOptimizer: remove unused variable
...
swift/lib/SILOptimizer/Utils/Generics.cpp:1429:9: warning: unused variable 'SM' [-Wunused-variable]
2017-03-22 11:46:27 -07:00
Saleem Abdulrasool
ccae6e81f8
SILOptimizer: avoid "deprecation" warnings
...
The `dump` method is meant for interactive use in debuggers only. Use
the parameter form to avoid the warning.
2017-03-22 11:43:50 -07:00
Roman Levenstein
fae0628a97
Implement partial specialization which supports generic substitutions.
...
Use -sil-partial-specialization-with-generic-substitutions to enable the partial specialization even in cases of substitutions containing generic replacement types.
2017-03-21 08:46:40 -07:00
swift-ci
d12334301e
Merge pull request #8236 from hughbe/clang-latest-error-fixes
2017-03-21 06:04:17 -07:00
Hugh Bellamy
d1849d7c28
Fix top of tree Clang compilation errors
2017-03-21 19:16:39 +07:00
Hugh Bellamy
d9879522fb
Fix top of tree Clang unused lambda capture warnings
2017-03-21 19:15:08 +07:00
Slava Pestov
99da2ea244
Merge pull request #8211 from practicalswift/use-is-instead-of-getas-where-appropriate
...
[gardening] Use .is<T>() instead of .getAs<T>() if the result is not needed
2017-03-21 00:39:23 -07:00
Erik Eckstein
977b5c05ad
Mangling: add a verifier that checks if every mangled symbol can be demangled and remangled.
2017-03-20 16:12:23 -07:00
practicalswift
83526fe224
[gardening] Use .is<T>() instead of .getAs<T>() if the result is not needed
2017-03-20 22:54:01 +01:00
Erik Eckstein
d70bfc5de2
rename namespace NewMangling -> Mangle
2017-03-20 10:09:30 -07:00
Erik Eckstein
2fbbef2fb4
Mangling: drop the support of mangling a function specialization argument which is an old-mangled function
2017-03-17 16:10:36 -07:00
Erik Eckstein
1625345b90
Remove the old mangler.
...
NFC
2017-03-17 16:10:36 -07:00
Roman Levenstein
c336dafb04
[sil-generic-specializer] Provide a possibility to disable the indirect-to-direct conversions of parameters and results
...
This is required by the capture propagation pass. Indirect-to-direct conversions are still performed by default.
2017-03-15 08:27:21 -07:00
Greg Parker
44135ae69a
Revert "[sil-capture-propagation] Switch to the new notifyAddFunction API"
2017-03-15 00:49:07 -07:00
Roman Levenstein
b3f558321a
[sil-generic-specializer] Provide a possibility to disable the indirect-to-direct conversions of parameters and results
...
This is required by the capture propagation pass. Indirect-to-direct conversions are still performed by default.
2017-03-14 17:37:19 -07:00
Greg Parker
5c01a65a40
Revert "[sil-capture-propagation] Support generic partial_apply instructions"
2017-03-14 17:32:42 -07:00
Roman Levenstein
ea3d69130c
Merge pull request #8081 from swiftix/wip-capture-propagation-generics
...
[sil-capture-propagation] Support generic partial_apply instructions
2017-03-14 17:09:12 -07:00
Joe Shajrawi
e20653ad04
Merge pull request #8090 from shajrawi/ConsumptionKind_UnconditionalCheckedCastValue
...
Add consumption kind to UnconditionalCheckedCastValueInst
2017-03-14 15:30:26 -07:00
Joe Shajrawi
ea4ba25b8a
Add consumption kind to UnconditionalCheckedCastValueInst
2017-03-14 13:53:05 -07:00
John McCall
3c5de5fa0a
Preserve type canonicality better in several places and
...
idiomatize some uses of SILType::getSwiftRValueType().
2017-03-14 14:59:43 -04:00
John McCall
897f5ab7c5
Restore CanType-based micro-optimizations.
...
This reverts commit 5036806e5a .
However, it preserves a pair of changes to the SIL optimizer
relating to walking through optional types.
2017-03-14 11:38:11 -04:00
Roman Levenstein
65091d6dbf
[sil-generic-specializer] Provide a possibility to disable the indirect-to-direct conversions of parameters and results
...
This is required by the capture propagation pass. Indirect-to-direct conversions are still performed by default.
2017-03-14 08:36:00 -07:00
Slava Pestov
5036806e5a
AST: Remove some unnecessary getCanonicalType() calls
2017-03-13 02:24:36 -07:00
Roman Levenstein
2b5585410b
[sil-generic-specializer] Don't specialize types which are too wide or too deep
...
This improves the existing logic which is used to stop specialization for types that are too big to handle. It catches some pathological cases which hang the compiler.
Fixes rdar://30938882
Re-applying this commit, which was speculatively reverted. It turned out that that performance tests issues were unrelated.
2017-03-12 11:40:30 -07:00
Roman Levenstein
5f4cc96267
Revert "[sil-generic-specializer] Don't specialize types which are too wide or too deep"
...
This speculatively reverts commit f07743b117 , because it seems to have caused compiler hangs on performance bots.
2017-03-11 07:14:02 -08:00
Roman Levenstein
3738b00b6f
Merge pull request #7973 from swiftix/wip-fso-fixes
...
[function-signature-opt] Allow FSO on witness_methods when performing the dead argument signature optimization for partial_apply instructions
2017-03-09 23:18:57 -08:00
eeckstein
cc6045b45a
Merge pull request #8006 from eeckstein/demangle-lib
...
demangler: put the demangler into a separate library
2017-03-09 16:40:35 -08:00
Erik Eckstein
5e80555c9b
demangler: put the demangler into a separate library
...
Previously it was part of swiftBasic.
The demangler library does not depend on llvm (except some header-only utilities like StringRef). Putting it into its own library makes sure that no llvm stuff will be linked into clients which use the demangler library.
This change also contains other refactoring, like moving demangler code into different files. This makes it easier to remove the old demangler from the runtime library when we switch to the new symbol mangling.
Also in this commit: remove some unused API functions from the demangler Context.
fixes rdar://problem/30503344
2017-03-09 13:42:43 -08:00
Roman Levenstein
f07743b117
[sil-generic-specializer] Don't specialize types which are too wide or too deep
...
This improves the existing logic which is used to stop specialization for types that are too big to handle. It catches some pathological cases which hang the compiler.
Fixes rdar://30938882
2017-03-09 12:09:53 -08:00
Slava Pestov
76eb5dd66d
SILGen: Clean up ad-hoc SubstitutionList construction when calling intrinsics
...
Change emitApplyOfLibraryIntrinsic() to take a SubstitutionMap,
and use the correct abstractions to build the map.
This gets rid of the last remaining uses of gatherAllSubstitutions()
in SIL.
2017-03-08 13:54:29 -08:00
Slava Pestov
5465c8ca8f
SIL: Remove most usages of TypeBase::gatherAllSubstitutions()
2017-03-08 13:54:28 -08:00
Slava Pestov
5381921131
AST: Generalize SubstitutionMap::combineSubstitutionMaps()
2017-03-08 13:54:28 -08:00
Roman Levenstein
be5e01af31
[function-signature-opt] Allow FSO on witness_methods when performing the dead argument signature optimization for partial_apply instructions
...
This improves performance of some benchmarks, which pass static operators like `Int.<` as closure arguments.
Fixes rdar://23428804
2017-03-07 19:58:49 -08:00
Joe Shajrawi
33b0cf653f
Rename unconditional_checked_cast_opaque to unconditional_checked_cast_value
2017-03-07 18:53:52 -08:00
Saleem Abdulrasool
d018ce272d
Adjust for SVN r297121
...
The forwarding functions have been removed. Adjust accordingly.
2017-03-07 10:25:36 -08:00
Joe Shajrawi
ca77872ba8
Merge CheckedCastValueBranch with new master
2017-03-06 17:32:09 -08:00
Joe Shajrawi
1f626304f1
Add support for conditional checked cast instruction for opaque value types + SILGen support for it
2017-03-06 16:35:27 -08:00
Roman Levenstein
d85013ecaf
Small fixes based on review comments.
2017-03-06 13:51:18 -08:00
Roman Levenstein
d6e842524b
[sil-generic-specializer] Canonicalize the substituted type of the specialized function in the context of a new generic signature
2017-03-06 12:54:11 -08:00