I noticed that we were not folding expressions like this:
icmp ult (constexpr), null
in https://llvm.org/PR49355, so we end up with extremely large icmp instructions as the constant expressions pile up on each other.
Unless I am misunderstanding, there is no potential to mis-fold an unsigned boundary condition with a zero/null, so this is just a falling through a crack in the pattern matching.
The more general case of comparisons of non-zero constants and constexpr are more tricky and may require the datalayout to know how to cast to different types, etc.
I think it would be good to test other inequality comparison opcodes too, if only as negative tests.