Commit Graph

10 Commits

Author SHA1 Message Date
Alexander Cyon
c18a24e499 [SwiftCompilerSources] Fix typos 2024-08-08 22:22:39 -07:00
Erik Eckstein
def3b6fab0 AccessUtils: recognize addressor calls of globals as a "global" access base
Makes e.g. alias analysis more precise in the early stage of the pass pipeline where addressor calls are not inlined, yet.
2024-08-05 17:12:46 +02:00
Erik Eckstein
ceda41ca90 AccessUtils: fix handling of store_borrow in AccessBase.isDistinct
The result of a store_borrow can "escape" to other access bases, like a "pointer" access base.
Then a store-borrow access base is _not_ distinct from such another base.
2024-07-29 17:33:46 +02:00
Erik Eckstein
983d95509d AccessUtils: do a simple type-based alias analysis in AccessBase.isDistinct
If the operand types (which are classes) of `ref_element_addr` or `ref_tail_addr` differ, then we know those can't be the same objects.
2024-07-29 17:33:46 +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
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
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
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