Introduce a cache to avoid looking up then/else region nesting through `isAncestor` calls repeatedly. This gets expensive for large inputs with lots of pointer chasing. Fixes https://github.com/llvm/llvm-project/issues/166039
Introduce a cache to avoid looking up then/else region nesting through `isAncestor` calls repeatedly. This gets expensive for large inputs with lots of pointer chasing. Fixes https://github.com/llvm/llvm-project/issues/166039