Skip to content

Conversation

@eeckstein
Copy link
Contributor

Beside cleaning up the source code, the motivation for the translation into Swift is to make it easier to improve the pass for some InlineArray specific optimizations (though I'm not sure, yet if we really need those).
Also, the new implementation doesn't contain the optimize-store-into-temp optimization anymore, because this is covered by redundant load elimination.

@eeckstein eeckstein requested a review from jckarter as a code owner May 5, 2025 10:37
@eeckstein eeckstein requested review from atrick, meg-gupta and nate-chandler and removed request for jckarter May 5, 2025 10:37
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci apple silicon benchmark

eeckstein added 5 commits May 6, 2025 12:35
It's based on `InstructionSet` but also provides a `count` property
…tionOfDest` -> `isInitializationOfDestination`

Trying to avoid abbreviations in ABI names
* `OpenExistentialAddrInst.isImmutable`
* `YieldInst.convention`
* `CopyAddrInst.set(isTakeOfSource:)` and `CopyAddrInst.set(isInitializationOfDestination:)`
Beside cleaning up the source code, the motivation for the translation into Swift is to make it easier to improve the pass for some InlineArray specific optimizations (though I'm not sure, yet if we really need those).
Also, the new implementation doesn't contain the optimize-store-into-temp optimization anymore, because this is covered by redundant load elimination.
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein merged commit 84058a7 into swiftlang:main May 6, 2025
3 checks passed
@eeckstein eeckstein deleted the temprvalue-opt branch May 6, 2025 17:37
Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically looks good. But I really wish things like UseCollector were using AddressUseVisitor instead of AddressDefUseWalker. Otherwise I can't reason about correctness and it could easily break as SIL evolves. The operations that AddressDefUseWalker follows or calls "leaf" are arbitrary, so the default implementation is tightly coupled with all the conformances. It will be important for passes like this to handle mark_dependence and mark_dependence_addr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants