Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Trick
dfe62b442e Allow AddressUseDefWalker to continue past MarkUninitializedInst.
This makes SwiftCompilerSources address/access utilities consistent with C++ and
allows them to be used in diagnostic passes.
2024-05-14 10:31:24 -07:00
Erik Eckstein
3c368575b4 SwiftCompilerSources: add a few utility APIs 2024-04-10 13:38:10 +02:00
Andrew Trick
a0b2ae9c2c Add AccessBase.storeBorrow.
Don't treat StoreBorrow addresses as unknown bases. While they are never the base of a formal access, they are returned
as the AccessBase when querying the enclosing scope of an address.
2024-03-22 11:51:58 -07:00
Andrew Trick
6b3d62cb5e SwiftCompilerSources: Add append methods to SingleInlineArray. 2024-03-18 17:38:12 -07:00
Andrew Trick
d6d8323775 Add SingleInlineArray read/_modify accessors
For mutable access.
2024-03-04 10:17:13 -08:00
Andrew Trick
e3198ed38e Fix AccessUtils.swift to use the project_box reference root. 2024-02-26 00:20:46 -08:00
Andrew Trick
7574c1fede Fix AccessUtils Value.referenceRoot to handle ForwardingInstructions.
This fixes all analyses that use AccessUtils in the presence of new
forwarding instructions. This is also needed for consistency with the
C++ source base. And for general sanity.

Utilities that walk the use-def chain should never hard-code a list of
opcodes that happened to work with some specific pass. Passes should
never assume that a basic SIL utility handles specific SIL operations
a certain way. Instead, the utility needs to be defined in terms of
SIL semantics. In this case, the utility is supposed to handle all
instructions that semantically forward ownership of a reference.
2024-02-26 00:20:46 -08:00
Andrew Trick
fcb8612c18 Format SingleInlineArray for use in lit tests. 2024-02-12 20:03:38 -08:00
Andrew Trick
03bda631f1 AccessUtils: comment typo 2024-02-12 09:57:14 -08:00
Andrew Trick
17319fa843 Improve the AddressUtils and OwnershipLiveness APIs 2024-01-30 08:38:57 -08:00
Andrew Trick
4796e55256 SwiftCompilerSources CopyingInstruction
And UnmanagedRetain/Release.
2024-01-30 08:38:57 -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
Andrew Trick
3f0d309ed4 SwiftCompilerSources: add Sequence.walk() 2023-12-19 02:05:16 -08:00
Erik Eckstein
80ace58104 SwiftCompilerSources: split SIL/Utils.swift into multiple files 2023-12-01 19:20:13 +01:00
Erik Eckstein
ec4c815506 SwiftCompilerSources: move WalkUtils and AccessUtils from the Optimizer module to the SIL module
Those utilities are conceptually part of the SIL definition.
2023-12-01 19:20:13 +01:00