[SSADestroyHoisting] Avoid second per-var dataflow.
[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 *>.

roambotics/swift,JGiola/swift,glessard/swift,ahoppen/swift,roambotics/swift,glessard/swift,apple/swift,gregomni/swift,glessard/swift,atrick/swift,gregomni/swift,JGiola/swift,benlangmuir/swift,rudkx/swift,gregomni/swift,atrick/swift,benlangmuir/swift,gregomni/swift,apple/swift,ahoppen/swift,apple/swift,roambotics/swift,atrick/swift,JGiola/swift,apple/swift,benlangmuir/swift,ahoppen/swift,ahoppen/swift,rudkx/swift,rudkx/swift,rudkx/swift,rudkx/swift,apple/swift,JGiola/swift,atrick/swift,JGiola/swift,gregomni/swift,JGiola/swift,ahoppen/swift,atrick/swift,benlangmuir/swift,ahoppen/swift,atrick/swift,glessard/swift,benlangmuir/swift,roambotics/swift,gregomni/swift,rudkx/swift,glessard/swift,roambotics/swift,glessard/swift,benlangmuir/swift,apple/swift,roambotics/swift