https://github.com/nikic commented: Would it be possible to handle this more generically instead, by teaching foldICmpBinOpWithConstantViaTruthTable to fold zext x into select x, 1, 0? https://github.com/llvm/llvm-project/pull/180596