Commit Graph

14 Commits

Author SHA1 Message Date
Meghana Gupta
32cd86f719 Update access base for borrow/mutate accessors in SwiftCompilerSources 2025-11-06 10:55:39 -08:00
Erik Eckstein
70ba193cd4 SIL: handle drop_deinit in WalkUtils
Also, handle some other missing instructions in the AddressDefUseWalker, which are visited in the AddressUseDefWalker.

This enables various other optimizations, like copy elimination, in the presence of `drop_deinit`.

rdar://152307747
2025-06-05 14:13:51 +02:00
Erik Eckstein
f6ce61cf43 SIL: support vector_base_addr in AccessUtils and WalkUtils
This enables alias analysis and optimizations, like, redundant load elimination, to benefit from it.
2025-05-12 19:24:32 +02:00
Andrew Trick
43debc529f [NFC] minor cleanup 2025-04-16 16:43:23 -07:00
Andrew Trick
d9dd93560d Support mark_dependence_addr in SIL passes. 2025-03-25 23:02:45 -07:00
WeZZard
4c479824ef [SILOptimizer] Eliminate non-case handling for implicit Optional non-Optional casting of unchecked_ref_cast in ValueDefUseWalker. 2025-03-11 09:39:50 +08:00
WeZZard
35f82ba402 [SILOptimizer] Fixes the ValueDefUseWalker to handle potential unchecked_ref_cast between optional and non-optional class types.
The `unchecked_ref_cast` is designed to be able to cast between
`Optional<ClassType>` and `ClassType`. We need to handle these cases by
checking if the type is optional and adjust the path accordingly.
2025-03-10 19:17:31 +08:00
Erik Eckstein
aa274a213b WalkUtils: handle mark_dependence instruction in the ValueUseDefWalker
It was already handled in the ValueDefUseWalker
2024-11-28 09:40:13 +01:00
Alexander Cyon
c18a24e499 [SwiftCompilerSources] Fix typos 2024-08-08 22:22:39 -07:00
Erik Eckstein
b739c6263b WalkUtils: handle unsafe_ref_cast which casts between AnyObject and a class
We need to ignore such casts because otherwise the constructed walking path wouldn't contain the right `existential` field kind.
Fixes a miscompile caused by redundant load elimination.

rdar://132364917
2024-07-24 11:35:08 +02:00
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
Andrew Trick
4796e55256 SwiftCompilerSources CopyingInstruction
And UnmanagedRetain/Release.
2024-01-30 08:38:57 -08:00
Andrew Trick
3f0d309ed4 SwiftCompilerSources: add Sequence.walk() 2023-12-19 02:05:16 -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