https://github.com/bcardosolopes approved this pull request. LGTM. Constraining the parameters makes the deep walk, the cache and the mutex unnecessary, and the speedup is a nice bonus. Good to go when CI is green tho https://github.com/llvm/llvm-project/pull/233846