https://github.com/nikic requested changes to this pull request. I haven't checked whether it might be safe in this context, but the m_NonZero you added here is an unacceptable footgun: It allows undef values that may refine to zero. https://github.com/llvm/llvm-project/pull/85298