You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SSADestroyHoisting] Avoid second per-var dataflow.
In order to determine which end_access instructions are barriers to
hoisting, a data flow which looks for access scopes containing barriers
is run. Those scopes that do contain barriers are added to a set. When
the second pass runs, the end_access instructions corresponding to
scopes in that set (i.e. the ends of scopes which contain barriers) are
treated as barriers.
In the common case where there are no barrier access scopes, though,
running two dataflows per variable is wasteful. Avoid that by just
checking whether we found any scopes that are barriers. If we didn't,
then we already visited all the barrier instructions and were told by
BackwardReachability which blocks had reachable ends and begins.
Tweaked the first data flow to record the barriers and the blocks in
DeinitBarriers. In DeinitBarriers::compute, if no access scopes that
are barriers were found, stop working. If any were found, clear what
had been recorded so far and run the second data flow.
In order to be able to clear everything, switched from using
BasicBlockSet and BasicBlockSetVector to SmallPtrSet<SILBasicBlock *>
and SmallPtrSetVector<SILBasicBlock *>.
0 commit comments