Slava Pestov
09b061bd0d
SIL: Preliminary type lowering for PackType and PackExpansionType
2022-11-08 19:09:07 -05:00
nate-chandler
9e4c9ce612
Merge pull request #61917 from nate-chandler/opaque-values/1/20221103
...
[OpaqueValues] Follow-up to #61846 .
2022-11-03 20:08:04 -07:00
Nate Chandler
bfd865b6b6
[ApplySite] Renamed insertAfterApplication.
...
Now that it can be called on partial_apply instructions,
insertAfterFullEvaluation does not name what the function does. One
could imagine a function which inserted after the applies of
(non-escaping) partial_applies.
2022-11-03 13:52:42 -07:00
Allan Shortlidge
23fe16875c
Merge pull request #61886 from tshortli/silgen-has-symbol-forward-decls
...
SILGen: Forward declare SIL functions referenced by `#_hasSymbol` query helpers
2022-11-03 13:06:51 -07:00
nate-chandler
f931727f76
Merge pull request #61846 from nate-chandler/opaque-values/1/20221027
...
[OpaqueValues] Handle PartialApplyInsts and @out tuples.
2022-11-03 08:05:05 -07:00
Allan Shortlidge
38779f32c1
SILGen/IRGen: Delegate decision to skip @_silgen_name functions to TBDGenVisitor.
...
This allows SILGen for `#_hasSymbol` conditions to visit them and emit a declaration of the function appropriately.
2022-11-02 21:38:33 -07:00
Allan Shortlidge
54e5fa0fbb
SILGen: Record the declarations that need a #_hasSymbol query function generated.
...
The query functions will be fully defined by IRGen.
2022-11-02 21:38:33 -07:00
Allan Shortlidge
e92a0ff6d9
NFC: Fix typo in SILModule.h.
2022-11-02 21:38:33 -07:00
Allan Shortlidge
cc789c4c97
NFC: Fix typo in SILLinkage.h.
2022-11-02 21:38:33 -07:00
Erik Eckstein
c9c216983e
SIL: fix static size assert for SILNode for 32 bit builds
...
rdar://101766531
2022-11-02 08:24:21 +01:00
Nate Chandler
332750d1fd
[SILGen] Handle @out tuple expansion.
...
When branching to the exit block, flatten an @out tuple return value
into its components, as is done for all other return values.
In the exit block, when constructing the @out tuple to return, visit the
tuple-type-tree of the return value to reconstruct the nested tuple
structure: @out tuple returns are not flattened, unlike regular tuple
returns.
2022-11-01 13:02:32 -07:00
Nate Chandler
78a8409ac1
[ApplySite] Promoted insertAfter to ApplySite.
...
Previously the API was only on FullApplySite, but it is useful to be
able to insert code after a partial_apply as well.
2022-11-01 13:02:32 -07:00
Nate Chandler
b0bcc75051
[SILGen] Handle @out tuple expansion.
...
When branching to the exit block, flatten an @out tuple return value
into its components, as is done for all other return values.
In the exit block, when constructing the @out tuple to return, visit the
tuple-type-tree of the return value to reconstruct the nested tuple
structure: @out tuple returns are not flattened, unlike regular tuple
returns.
2022-11-01 10:37:25 -07:00
Nate Chandler
18d34f73a3
[ApplySite] Promoted insertAfter to ApplySite.
...
Previously the API was only on FullApplySite, but it is useful to be
able to insert code after a partial_apply as well.
2022-11-01 10:36:53 -07:00
Allan Shortlidge
a44b54b818
NFC: Refactor the logic of TBDGenVisitor into two helper classes; SILSymbolVisitor and IRSymbolVisitor.
2022-10-30 09:14:29 -07:00
Allan Shortlidge
cfb5ad8836
Merge pull request #61779 from tshortli/break-cycle-loop-can-duplicate
...
SILOptimizer: Break circular dependency with SIL library by moving `canDuplicate()`
2022-10-27 22:43:47 -07:00
Allan Shortlidge
53ac896853
Merge pull request #61770 from tshortli/fix-sil-silgen-circular-dependency
...
Interop: Untangle circular dependency introduced by #59787
2022-10-27 20:04:15 -07:00
Allan Shortlidge
0921480486
SILOptimizer: Break circular dependency with SIL library by moving canDuplicate().
...
Fixes a cycle introduced by https://github.com/apple/swift/pull/61051 .
2022-10-27 16:12:05 -07:00
Allan Shortlidge
4f8d33ffb5
SILOptimizer: Break circular dependency with SIL library by moving extendStoreBorrow().
2022-10-27 15:29:37 -07:00
Allan Shortlidge
f5d760e613
Interop: Untangle circular dependency introduced by #59787
...
The changes for https://github.com/apple/swift/pull/59787 introduced a circular depenendcy between the SIL library and the SILGen library. I have undone this in the cheapest way possible as I don't have bandwidth to look into a more correct fix at the moment.
2022-10-27 13:17:38 -07:00
Allan Shortlidge
0d37f52fe0
APIDigester: Break cycle between Frontend and APIDigester targets.
...
Also push a utility that was previously on `SILDeclRef` down to AST so that the SIL dependency can be removed entirely from APIDigester.
2022-10-26 20:30:36 -07:00
Saleem Abdulrasool
5456c71a08
Merge pull request #61727 from meg-gupta/revertnewsilcombine
...
Revert "Implement several peephole optimizations to unblock further o…
2022-10-26 08:16:25 -07:00
Meghana Gupta
5e20112e0c
Revert "Implement several peephole optimizations to unblock further optimizations of autodiff code ( #60520 )"
...
This reverts commit 2f5492f572 .
2022-10-25 13:35:14 -07:00
Michael Gottesman
14c687a577
[move-only] Emit the move only marker for move only trivial enums.
...
Just an oversight I discovered when writing the enum deinit tests.
2022-10-24 20:05:04 -07:00
nate-chandler
9c17447158
Merge pull request #61654 from nate-chandler/shrink_borrow_scope/handle_barrier_merge_terminators
...
Removed deinit barrier workaround.
2022-10-24 14:40:21 -07:00
Nate Chandler
f98917b1fe
Removed workaround for missing Swift sources.
...
Previously, to workaround an issue with ShrinkBorrowScope (where it
assumed a reasonable definition of isDeinitBarrier), a placeholder
version of the function was added. It is now removed by moving the
implementation of a version of that predicate back to C++.
2022-10-24 08:47:18 -07:00
Meghana Gupta
79496ab513
Return BorrowedValueKind::Invalid for GuaranteedForwardingPhi
2022-10-21 11:46:31 -07:00
Egor Zhdan
a6372e955a
Merge pull request #61618 from apple/egorzhdan/scs-reapply-enums
...
Revert "Revert "[cxx-interop][SwiftCompilerSources] Use C++ enums directly from Swift""
2022-10-20 15:46:17 +01:00
Erik Eckstein
698196b1eb
SILFunction: add getMemoryBehavior
...
This retrieves the side effect information from the function effects.
2022-10-20 09:20:28 +02:00
Erik Eckstein
f6fb3c75db
SILInstructions.h: fix ApplyInstBase::getSingleResult()
2022-10-20 09:20:28 +02:00
Erik Eckstein
173b698563
Swift SIL: add ApplySite.numIndirectResultArguments
2022-10-20 09:20:28 +02:00
Erik Eckstein
ecbcacdecf
SIL Analysis: Rename InvalidationKind::FunctionData to InvalidationKind::Effects
...
This invalidation kind is used when a compute-effects pass changes function effects.
Also, let optimization passes which don't change effects only invalidate the `FunctionBody` and not `Everything`.
2022-10-20 09:20:28 +02:00
Meghana Gupta
ebd7a90587
NFC: Remove unused code + reorg
2022-10-19 19:54:28 -07:00
Meghana Gupta
786eb94853
Support @guaranteed forwarding phis
2022-10-19 19:54:27 -07:00
Meghana Gupta
b1f719709b
Rename ForwardingBorrow -> GuaranteedForwarding
2022-10-19 19:54:27 -07:00
nate-chandler
513b9cbb4d
Merge pull request #61495 from nate-chandler/rdar90412220
...
[SILOptimizer] Add deinit-barrier side-effect.
2022-10-19 18:21:26 -07:00
Nate Chandler
7ea336367d
[NFC] Port isDeinitBarrier to Swift.
...
Added new C++-to-Swift callback for isDeinitBarrier.
And pass it CalleeAnalysis so it can depend on function effects. For
now, the argument is ignored. And, all callers just pass nullptr.
Promoted to API the mayAccessPointer component predicate of
isDeinitBarrier which needs to remain in C++. That predicate will also
depends on function effects. For that reason, it too is now passed a
BasicCalleeAnalysis and is moved into SILOptimizer.
Also, added more conservative versions of isDeinitBarrier and
maySynchronize which will never consider side-effects.
2022-10-18 21:23:22 -07:00
Egor Zhdan
94ec683ba5
Revert "Revert "[cxx-interop][SwiftCompilerSources] Use C++ enums directly from Swift""
...
This reverts commit 69431f00
2022-10-18 18:55:57 +01:00
Utkarsh Saxena
1d61437727
Add matching operator!= for asymmetric operator==
...
This helps clang to compile target in C++20 mode.
Context: https://github.com/llvm/llvm-project/issues/57711
2022-10-18 16:47:01 +02:00
Hamish Knight
350e28b4b7
[Profiler] Rework profiling of top-level code
...
Instead of creating and destroying a SILProfiler
per TopLevelCodeDecl, setup a single profiler
for the top-level entry point function, and visit
all the TopLevelCodeDecls when mapping regions.
2022-10-14 17:45:14 +01:00
Hamish Knight
d1e2ac15d4
Factor out SILDeclRef::getInitializationExpr
2022-10-14 17:45:12 +01:00
Hamish Knight
1c9b77ef54
Merge pull request #61566 from hamishknight/countdown
2022-10-14 13:57:48 +01:00
Hamish Knight
b4d4137a5e
[Profiler] NFC: Trim out unused imports
...
Also bump the copyright year.
2022-10-13 19:42:38 +01:00
Hamish Knight
809cfb7bf2
[Profiler] Introduce ProfileCounterRef
...
For now this just wraps an ASTNode, but in the
future it will allow us to model counters
that cannot simply hang off ASTNodes, e.g
error branch counters.
2022-10-13 19:42:37 +01:00
Andrew Trick
5270079265
Merge pull request #61558 from atrick/scoped-liveness
...
Handle scoped address in PrunedLiveness
2022-10-13 08:47:28 -07:00
Andrew Trick
b52cccec62
Add ScopedAddressValue::forUse to find use points
...
These are the use points for begin_access and store_borrow operands.
2022-10-12 09:36:40 -07:00
Andrew Trick
d8e1fca1e4
Add a comment to PrunedLiveness explaining use points.
2022-10-12 09:36:40 -07:00
Nate Chandler
ab35362056
[SIL] Added new test_specification instruction.
...
The new instruction exists only to be used in tests. The idea is to
specify tests that ought to be run "in the context" of the containing
function.
2022-10-11 17:15:13 -07:00
Holly Borla
54f42b5833
Merge pull request #61445 from hborla/pack-shape-requirements
...
[RequirementMachine] Implement inference and minimization of same-shape requirements.
2022-10-07 14:49:14 -07:00
swift-ci
4d561ee423
Merge pull request #61475 from atrick/liveness-cleanup
...
Liveness cleanup - preparation for OSSA liveness
2022-10-06 21:35:38 -07:00