[xla:hlo] Optimize hlo_dfs_reachability
[xla:hlo] Optimize hlo_dfs_reachability

name                               old cpu/op   new cpu/op    delta
BM_HloDfsReachabilityBuild/1       87.1ns ± 4%  100.5ns ± 4%  +15.40%  
BM_HloDfsReachabilityBuild/64      2.04µs ± 3%   1.72µs ± 3%  -15.33%  
BM_HloDfsReachabilityBuild/128     4.08µs ± 4%   3.44µs ± 2%  -15.68%  
BM_HloDfsReachabilityBuild/256     8.23µs ± 6%   6.95µs ± 3%  -15.57%  
BM_HloDfsReachabilityBuild/512     16.4µs ± 3%   14.2µs ± 2%  -13.12%  
BM_HloDfsReachabilityBuild/4096     174µs ± 3%    157µs ± 4%   -9.80%  
BM_HloDfsReachabilityBuild/32768   2.40ms ±41%   2.25ms ±43%     ~     
BM_HloDfsReachabilityBuild/262144  35.5ms ± 9%   33.8ms ± 6%   -4.93%  
BM_HloDfsReachabilityCheck/1       7.68ns ± 0%   7.67ns ± 1%     ~     
BM_HloDfsReachabilityCheck/64       670ns ± 4%    303ns ± 4%  -54.77%  
BM_HloDfsReachabilityCheck/128     1.34µs ± 2%   0.70µs ± 4%  -47.76%  
BM_HloDfsReachabilityCheck/256     2.76µs ± 4%   1.56µs ± 3%  -43.34%  
BM_HloDfsReachabilityCheck/512     5.50µs ± 2%   3.17µs ± 4%  -42.33%  
BM_HloDfsReachabilityCheck/4096    53.2µs ± 5%   31.3µs ± 7%  -41.29%  
BM_HloDfsReachabilityCheck/32768   1.00ms ± 7%   0.55ms ±11%  -45.43%  
BM_HloDfsReachabilityCheck/262144  14.6ms ±10%   10.5ms ± 7%  -28.04%
