} else if (match(LHS, m_And(m_Value(), m_ConstantInt(CI2)))) {
// 'and x, CI2' produces [0, CI2].
Upper = CI2->getValue() + 1;
+ } else if (match(LHS, m_NUWAdd(m_Value(), m_ConstantInt(CI2)))) {
+ // 'add nuw x, CI2' produces [CI2, UINT_MAX].
+ Lower = CI2->getValue();
}
if (Lower != Upper) {
ConstantRange LHS_CR = ConstantRange(Lower, Upper);
; CHECK-LABEL: @tautological8(
; CHECK: ret i1 false
}
+
+define i1 @tautological9(i32 %x) {
+ %add = add nuw i32 %x, 13
+ %cmp = icmp ne i32 %add, 12
+ ret i1 %cmp
+; CHECK-LABEL: @tautological9(
+; CHECK: ret i1 true
+}