When scalarizing PHI nodes we might try to examine/rewrite
InsertElement nodes in predecessors. If those predecessors
are unreachable from entry, then the IR in those blocks could
have unexpected properties resulting in infinite loops in
By simply treating values originating from instructions in
unreachable blocks as undef we do not need to analyse them
This fixes PR41723.