Fixed https://github.com/llvm/llvm-project/issues/62348
Propagate cross suspend point information along reverse post-order.
It does not modify the original function, just selects a better traversal order.
Before the patch:
n: 20000 4.31user 0.11system 0:04.44elapsed 99%CPU (0avgtext+0avgdata 552352maxresident)k 0inputs+8848outputs (0major+126254minor)pagefaults 0swaps n: 40000 11.24user 0.40system 0:11.66elapsed 99%CPU (0avgtext+0avgdata 1788404maxresident)k 0inputs+17600outputs (0major+431105minor)pagefaults 0swaps n: 60000 21.65user 0.96system 0:22.62elapsed 99%CPU (0avgtext+0avgdata 3809836maxresident)k 0inputs+26352outputs (0major+934749minor)pagefaults 0swaps n: 80000 37.05user 1.53system 0:38.58elapsed 99%CPU (0avgtext+0avgdata 6602396maxresident)k 0inputs+35096outputs (0major+1622584minor)pagefaults 0swaps n: 100000 51.87user 2.67system 0:54.54elapsed 99%CPU (0avgtext+0avgdata 10210736maxresident)k 0inputs+43848outputs (0major+2518945minor)pagefaults 0swaps
After the patch:
n: 20000 3.08user 0.12system 0:03.21elapsed 99%CPU (0avgtext+0avgdata 551012maxresident)k 0inputs+8848outputs (0major+129349minor)pagefaults 0swaps n: 40000 5.88user 0.33system 0:06.22elapsed 99%CPU (0avgtext+0avgdata 1789248maxresident)k 0inputs+17600outputs (0major+435096minor)pagefaults 0swaps n: 60000 8.84user 0.77system 0:09.63elapsed 99%CPU (0avgtext+0avgdata 3807800maxresident)k 0inputs+26352outputs (0major+939119minor)pagefaults 0swaps n: 80000 11.64user 1.58system 0:13.23elapsed 99%CPU (0avgtext+0avgdata 6604708maxresident)k 0inputs+35096outputs (0major+1629566minor)pagefaults 0swaps n: 100000 15.21user 2.56system 0:17.79elapsed 99%CPU (0avgtext+0avgdata 10208828maxresident)k 8inputs+43848outputs (0major+2526611minor)pagefaults 0swaps
The comment reads slightly odd. Also I feel it may not be necessary to require RPO in computeBlockData since it simply iterates the given range. So may be the following signature may be better: