Index: lib/Analysis/ScalarEvolution.cpp =================================================================== --- lib/Analysis/ScalarEvolution.cpp +++ lib/Analysis/ScalarEvolution.cpp @@ -3890,9 +3890,16 @@ Value *FalseVal) { // Try to match some simple smax or umax patterns. auto *ICI = dyn_cast(Cond); - if (!ICI) + if (!ICI) { + // If this is not an integer condition, it might still be a constant + if (auto *CI = dyn_cast(Cond)) { + if (CI->isOne()) + return getSCEV(TrueVal); + else + return getSCEV(FalseVal); + } return getUnknown(I); - + } Value *LHS = ICI->getOperand(0); Value *RHS = ICI->getOperand(1);