Process cases when phi incoming in predecessor block has select
instruction, and this select address is unavailable, but there
are addresses translated from both sides of select instruction.
Motivation
Consider the following PRE cases: https://godbolt.org/z/Mj6nb8qvs
In first test, latest load is partially redundant: both variants (A[i] and A[i+1]) are already available if i < N.
In second test, load of A[res] is redundant: both variants are availabe from previous iteration (A[res]) or from previous A[i] load. The only path where its unavailable is on first iteration from preheader block.
Both these cases are optimized properly by GCC.
Proposed fix in this patch is to support address translation through select instruction: if we had translation failure, but phi incoming is select instruction, we attempt to translate both sides of this selects and find loads from this pair of addresses. This can be treated as an extension of https://reviews.llvm.org/D118143.
Name convention, pls pre-commit NFC to fix it first.