Currently we express umin as ~umax(~x, ~y). However, this becomes
a problem for operands in non-integral pointer spaces, because ~x
is not something we can compute for x non-integral. However, since
comparisons are generally still allowed, we are actually able to
express umin(x, y) directly as long as we don't try to express is
as a umax. Support this by adding an explicit umin/smin representation
to SCEV. We do this by factoring the existing getUMax/getSMax functions
into a new function that does all four. The previous two functions
were largely identical, except that the SMax variant used isKnownPredicate
while the UMax variant used isKnownViaNonRecursiveReasoning.
Trying to make the UMax variant also use isKnownPredicate yields to
an infinite recursion, while trying to make the SMax variant use
isKnownViaNonRecursiveReasoning causes
Transforms/IndVarSimplify/backedge-on-min-max.ll to fail.
I would appreciate any insight into which predicate is correct here.
Let's avoid a nested ternary here. Maybe you could instead use an immediately executed lambda.