Skip to content

Commit 27fe849

Browse files
committed
[SILOptimizer] Epilogue matcher can find partial post dom argument releases.
Added getPartiallyPostDomReleaseSet to ConsumedArgToEpilogueReleaseMatcher. Given an argument, the new method returns the array of releases of the argument if there is an array thereof and if the releases therein do not jointly post-dominate the argument. Excerpted from @GottesM's swiftlang#16756.
1 parent 9bd6fec commit 27fe849

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/swift/SILOptimizer/Analysis/ARCAnalysis.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,17 @@ class ConsumedArgToEpilogueReleaseMatcher {
332332
return completeList.getValue();
333333
}
334334

335+
Optional<ArrayRef<SILInstruction *>>
336+
getPartiallyPostDomReleaseSet(SILArgument *arg) const {
337+
auto iter = ArgInstMap.find(arg);
338+
if (iter == ArgInstMap.end())
339+
return None;
340+
auto partialList = iter->second.getPartiallyPostDomReleases();
341+
if (!partialList)
342+
return None;
343+
return partialList;
344+
}
345+
335346
ArrayRef<SILInstruction *> getReleasesForArgument(SILValue value) const {
336347
auto *arg = dyn_cast<SILArgument>(value);
337348
if (!arg)

0 commit comments

Comments
 (0)