We should not lose analysis precision if an 'add' has both no-wrap flags (nsw and nuw) compared to just one or the other.
This patch is modeled on a similar construct that was added with D59386.
I don't think it is possible to expose a problem with an unsigned compare because of the way this was coded (nuw is handled first).
InstCombine has an assert that fires with the example from:
https://github.com/llvm/llvm-project/issues/52884
...because it was expecting InstSimplify to handle this kind of pattern with an smax.
just noticed this while reading the code. The bool arguments are swapped here. Should be: