@@ -550,6 +550,7 @@ foldNonNestedAccesses(AccessConflictAnalysis::AccessMap &accessMap) {
550
550
// Optimize this begin_access by setting [no_nested_conflict].
551
551
beginAccess->setNoNestedConflict (true );
552
552
changed = true ;
553
+ DEBUG (llvm::dbgs () << " Folding " << *beginAccess);
553
554
}
554
555
return changed;
555
556
}
@@ -585,6 +586,7 @@ removeLocalNonNestedAccess(AccessConflictAnalysis::Result &&result,
585
586
return result.getAccessIndex (a) < result.getAccessIndex (b);
586
587
});
587
588
for (BeginAccessInst *beginAccess : deadAccesses) {
589
+ DEBUG (llvm::dbgs () << " Removing dead access " << *beginAccess);
588
590
changed = true ;
589
591
removeBeginAccess (beginAccess);
590
592
}
@@ -612,8 +614,12 @@ struct AccessEnforcementOpts : public SILFunctionTransform {
612
614
invalidateAnalysis (SILAnalysis::InvalidationKind::Instructions);
613
615
614
616
// Use the updated AccessedStorageAnalysis to find any uniquely identified
615
- // local storage that has no nested conflict on any of its accesses. These
616
- // can be removed entirely.
617
+ // local storage that has no nested conflict on any of its accesses within
618
+ // this function. These can be removed entirely.
619
+ //
620
+ // Note that the storage address may be passed as an argument and there may
621
+ // be nested conflicts within that call, but none of the accesses within
622
+ // this function will overlap.
617
623
const FunctionAccessedStorage &functionAccess = ASA->getEffects (F);
618
624
if (removeLocalNonNestedAccess (std::move (result), functionAccess))
619
625
invalidateAnalysis (SILAnalysis::InvalidationKind::Instructions);
0 commit comments