The change made in this PR #150278 does not work.
The underlying bug seems to be that the SCFIfConditionPropagationPass never inserts individual regions into the visited sets. Since the visited sets are empty, when it checks if a region is contained in them, it always comes up false.
The test file mlir/test/Dialect/SCF/if-cond-prop.mlir matches the then statement of the outer most if statement which is why the test passes. The test never verifies that other if statements do not exist or if an else branch exists.