https://github.com/ftynse approved this pull request. Ultra-nit: I'd say directly "Compute the position of this block within its parent region using an O(N) linear scan." in the first line so it is more visible. https://github.com/llvm/llvm-project/pull/173475