This patch is the follow-up improvement of D122152.
Fixes https://github.com/llvm/llvm-project/issues/64558.
select (a | c), a, b -> select a, true, (select ~c, b, false) where c is free to invert
select (c & ~b), a, b -> select b, true, (select c, a, false)
Alive2: https://alive2.llvm.org/ce/z/KwxtMA
Instead of matching m_Not imo should match m_Specific and then check isFreeToInvert and generate CreateNot if that is the case.