As an alternative to setting threshold limits on CSE dominator queries, this approach requires tht the SlotIndex analysis be run before legalization, and to use the numbering to do constant time dominance checks. There is added complexity in needing to maintain the numbering as we add/remove instructions from the block.
Overall this seems to impact compile time negatively by about ~0.5% on -O0 and -Os but prevents us from having unreasonably long compile times in the worst cases.
clang-tidy: warning: invalid case style for parameter 'indexes' [readability-identifier-naming]
not useful