Erik Eckstein
68cc6c8780
SwiftCompilerSources: add all missing instruction classes
...
And require that all new instructions must be added and registered in SwiftCompilerSources as well.
2024-02-22 07:12:10 +01:00
Erik Eckstein
aadb0598c9
SIL: remove the var operands requirement from UnaryInstruction
...
It's not needed because UnaryInstruction is "derived" from Instruction which has this property.
2024-02-22 07:12:10 +01:00
Meghana Gupta
14578db701
Bridge createEndAccess
2024-02-13 00:12:23 -08:00
Andrew Trick
fcb8612c18
Format SingleInlineArray for use in lit tests.
2024-02-12 20:03:38 -08:00
Andrew Trick
e9762432d5
Improve Operand.isAddressInitialization to handle indirect results.
2024-02-12 09:57:14 -08:00
Andrew Trick
8b24382494
SwiftCompilerSources: cleanup and extend ArgumentConventions
...
Provide APIs needed by lifetime dependence diagnostics, namely LifetimeDependenceConvention.
Reorganize the APIs so it's easy to find related functionality which
API is responsible for which functionality.
Remove the originalFunctionConvention complexity. It is no longer
needed for lifetime dependence inference, and generally should be
avoided in SIL.
Add some placeholder FIXMEs because this not a good PR in which to
change existing functionality.
2024-02-12 09:57:14 -08:00
Andrew Trick
28b60e051d
Bridge SILFunctionType LifetimeDependenceInfo
2024-02-12 09:57:14 -08:00
Andrew Trick
03bda631f1
AccessUtils: comment typo
2024-02-12 09:57:14 -08:00
Andrew Trick
d0ac09493a
Bridge MarkDependence.resolveToNonEscaping
2024-02-12 09:57:14 -08:00
Andrew Trick
72fff912e7
SwiftCompilerSources: bridge Type.isEmpty
2024-02-12 09:57:14 -08:00
Andrew Trick
340bd26d23
SwiftCompilerSources: bridge isNoEscape and mayEscape.
2024-02-12 09:57:14 -08:00
Andrew Trick
ced850d092
SwiftCompilerSources: bridge GlobalVariable.varDecl
2024-02-12 09:57:14 -08:00
Andrew Trick
b1601a958b
Fix ApplySite.originalParameter(of:).
2024-02-12 09:57:14 -08:00
Andrew Trick
79fe8bad30
SwiftCompilerSources: improve MarkDependenceInst.
2024-02-12 09:57:14 -08:00
Andrew Trick
da3f583492
Add mark_dependence [unresolved]
...
In preparation for inserting mark_dependence instructions for lifetime
dependencies early, immediately after SILGen. That will simplify the
implementation of borrowed arguments.
Marking them unresolved is needed to make OSSA verification
conservative until lifetime dependence diagnostics runs.
2024-02-08 22:53:16 -08:00
Erik Eckstein
31f3102540
swift SIL: fix Function.isGeneric
...
It didn't work for functions in generic contexts, which don't add a generic parameter themselves
2024-01-31 17:16:18 +01:00
Erik Eckstein
3b239b25f3
swift SIL: add Function thunk APIs
...
* `var thunkKind`
* `set(thunkKind:)`
2024-01-31 17:16:13 +01:00
Erik Eckstein
fa0be3c10f
SwiftCompilerSources: bridge some SIL APIs
...
* `TryApplyInst.specializationInfo`
* `BasicBlock.addFunctionArgument`
* `Function.appendNewBlock`
2024-01-31 17:16:12 +01:00
Erik Eckstein
a98448b89a
swift Builder: add a few instruction creation functions
2024-01-31 17:16:12 +01:00
Erik Eckstein
240fa6d937
SIL: make swift ParameterInfo convertible back to C++ SILParameterInfo
2024-01-31 17:16:12 +01:00
Erik Eckstein
7a62f15dae
pass Context: verify that only the currently transformed function is modified
2024-01-31 17:16:12 +01:00
Andrew Trick
4f03241759
Bridge Argument.varDecl
2024-01-30 08:38:57 -08:00
Andrew Trick
17319fa843
Improve the AddressUtils and OwnershipLiveness APIs
2024-01-30 08:38:57 -08:00
Andrew Trick
800fa167a9
ForwardingUtils; minor cleanup
2024-01-30 08:38:57 -08:00
Andrew Trick
1c8a150d95
SwiftCompilerSources: register the new instructions.
2024-01-30 08:38:57 -08:00
Andrew Trick
4796e55256
SwiftCompilerSources CopyingInstruction
...
And UnmanagedRetain/Release.
2024-01-30 08:38:57 -08:00
Andrew Trick
9950784adb
SwiftCompilerSources API for SourceDestAddrInstructions.
2024-01-30 08:38:57 -08:00
Andrew Trick
1396d6b9d0
Bridge YieldInfo
2024-01-30 08:38:57 -08:00
Andrew Trick
9770ce41a2
Improve the ArgumentConvention API
2024-01-30 08:38:57 -08:00
Arnold Schwaighofer
edd7eaa0d7
OSLog: os_log strings should be in the __oslogstring section on machO
...
rdar://121384422
2024-01-26 08:30:56 -08:00
Andrew Trick
3f8a35e64f
ForwardingUtils comments and cleanup.
2024-01-22 23:55:29 -08:00
Andrew Trick
d9a8a0eb60
Added SourceDestAddrInstruction
2024-01-22 23:42:54 -08:00
Andrew Trick
e7a3ceb0d5
SwiftCompilerSources: add VarDecl.sourceLoc
2024-01-22 08:29:07 -08:00
Andrew Trick
a80686b485
[SIL] bridge MoveValue and BeginBorrow .isFromVarDecl
2024-01-22 08:29:07 -08:00
Andrew Trick
e4d8277723
SwiftCompilerSources: add UseList ignoreTypeDependence
2024-01-17 08:37:14 -08:00
Andrew Trick
f69dfe4e79
Add OperandOwnership.endsLifetime
...
And rename `uses.lifetimeEndingUses` to `uses.endingLifetime`
2024-01-17 08:37:14 -08:00
Andrew Trick
d8b901052a
Add Swift SIL instructions needed by AddressUseVisitor
2024-01-17 08:37:14 -08:00
Erik Eckstein
3229749257
SwiftCompilerSources: move some private utilities of passes into OptUtils
...
* `var Function.initializedGlobal`
* `func getGlobalInitialization`
and add `var CollectionLikeSequence.singleElement`
2024-01-10 09:34:01 +01:00
Erik Eckstein
bc99986cf9
SIL: add a dependency token operand to global_addr
...
Optionally, the dependency to the initialization of the global can be specified with a dependency token `depends_on <token>`.
This is usually a `builtin "once"` which calls the initializer for the global variable.
2024-01-10 09:33:58 +01:00
nate-chandler
7365f9f36b
Merge pull request #70774 from nate-chandler/nfc/20240108/1/deinit-barrier-component-predicates
...
[NFC] SIL: Clarified deinit barrier APIs.
2024-01-08 23:11:38 -08:00
Nate Chandler
77fd37be99
[NFC] SIL: Renamed maySynchronize.
...
Dropped the NotConsideringSideEffects suffix.
2024-01-08 13:35:20 -08:00
Andrew Trick
264cbaea42
Add mark_dependence [nonescaping] flag.
...
The dependent 'value' may be marked 'nonescaping', which guarantees that the
lifetime dependence is statically enforceable. In this case, the compiler
must be able to follow all values forwarded from the dependent 'value', and
recognize all final (non-forwarded, non-escaping) use points. This implies
that `findPointerEscape` is false. A diagnostic pass checks that the
incoming SIL to verify that these use points are all initially within the
'base' lifetime. Regular 'mark_dependence' semantics ensure that
optimizations cannot violate the lifetime dependence after diagnostics.
2024-01-04 14:47:35 -08:00
Andrew Trick
2128c21106
Migrate SwiftCompilerSources to FunctionConvention.
...
Layers:
- FunctionConvention: AST FunctionType: results, parameters
- ArgumentConventions: SIL function arguments
- ApplyOperandConventions: applied operands
The meaning of an integer index is determined by the collection
type. All the mapping between the various indices (results,
parameters, SIL argument, applied arguments) is restricted to the
collection type that owns that mapping. Remove the concept of a
"caller argument index".
2024-01-03 12:24:50 -08:00
Meghana Gupta
ba4cedd5e5
Merge pull request #70582 from meg-gupta/resultdependsoninsil
...
Make _resultDependsOn/_resultDependsOnSelf available in SIL
2024-01-02 10:49:20 -08:00
Erik Eckstein
85be96354f
SimplifyBuiltin: fix simplification of is_same_metatype with dynamic_self types
...
Dynamic self types are not the same as non-dynamic self types.
Fixes a miscompile with dynamic self type comparisons.
rdar://119943508
2024-01-02 09:23:42 +01:00
Meghana Gupta
3c56a7a88e
Bridge hasResultDependsOnSelf()
2023-12-29 02:06:15 -08:00
Meghana Gupta
334ede0b01
Bridge hasResultDependsOn()
2023-12-29 02:06:12 -08:00
Andrew Trick
7dc3d72483
Merge pull request #70485 from atrick/bridge-util
...
[NFC] Bridging and utilities for SwiftCompilerSources required by lifetime dependence utilities.
2023-12-19 13:07:45 -08:00
Andrew Trick
d0b47b878c
SwiftCompilerSources: add CollectionLikeSequence.contains()
2023-12-19 02:05:16 -08:00
Andrew Trick
3f0d309ed4
SwiftCompilerSources: add Sequence.walk()
2023-12-19 02:05:16 -08:00