@@ -53,3 +53,33 @@ define i32 @dec_size(i32 %x) optsize {
53
53
%r = add i32 %x , -1
54
54
ret i32 %r
55
55
}
56
+
57
+ declare {i32 , i1 } @llvm.uadd.with.overflow.i32 (i32 , i32 )
58
+ declare void @other (i32* ) nounwind ;
59
+
60
+ define void @cond_ae_to_cond_ne (i32* %p ) nounwind {
61
+ ; CHECK-LABEL: cond_ae_to_cond_ne:
62
+ ; CHECK: # %bb.0: # %entry
63
+ ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
64
+ ; CHECK-NEXT: addl $1, (%eax)
65
+ ; CHECK-NEXT: jae .LBB4_1
66
+ ; CHECK-NEXT: # %bb.2: # %if.end4
67
+ ; CHECK-NEXT: jmp other # TAILCALL
68
+ ; CHECK-NEXT: .LBB4_1: # %return
69
+ ; CHECK-NEXT: retl
70
+ entry:
71
+ %t0 = load i32 , i32* %p , align 8
72
+ %add_ov = call {i32 , i1 } @llvm.uadd.with.overflow.i32 (i32 %t0 , i32 1 )
73
+ %inc = extractvalue { i32 , i1 } %add_ov , 0
74
+ store i32 %inc , i32* %p , align 8
75
+ %ov = extractvalue { i32 , i1 } %add_ov , 1
76
+ br i1 %ov , label %if.end4 , label %return
77
+
78
+ if.end4:
79
+ tail call void @other (i32* %p ) nounwind
80
+ br label %return
81
+
82
+ return:
83
+ ret void
84
+ }
85
+
0 commit comments