This patch fixes llvm.org/pr49688 by conditionally folding select i1 into and/or:
select cond, cond2, false -> and cond, cond2
This is not safe if cond2 is poison whereas cond isn’t.
Unconditionally disabling this transformation affects later pipelines that depend on and/or i1s.
To minimize its impact, this patch conservatively checks whether cond2 is an instruction that
creates a poison or its operand creates a poison.
This approach is similar to what InstSimplify's SimplifyWithOpReplaced is doing.
clang-format not found in user's PATH; not linting file.