@@ -22,6 +22,20 @@ define i32 @p0_scalar(i32 %x, i32 %y) {
22
22
ret i32 %t1
23
23
}
24
24
25
+ define i8 @p0_scalar_not_truly_negatable (i8 %x , i8 %y ) {
26
+ ; CHECK-LABEL: @p0_scalar_not_truly_negatable(
27
+ ; CHECK-NEXT: [[XX:%.*]] = xor i8 [[X:%.*]], 123
28
+ ; CHECK-NEXT: [[TMP1:%.*]] = xor i8 [[Y:%.*]], -46
29
+ ; CHECK-NEXT: [[YY_NEG:%.*]] = add i8 [[TMP1]], 1
30
+ ; CHECK-NEXT: [[R:%.*]] = add i8 [[YY_NEG]], [[XX]]
31
+ ; CHECK-NEXT: ret i8 [[R]]
32
+ ;
33
+ %xx = xor i8 %x , 123
34
+ %yy = xor i8 %y , 45
35
+ %r = sub i8 %xx , %yy
36
+ ret i8 %r
37
+ }
38
+
25
39
;------------------------------------------------------------------------------;
26
40
; Vector tests
27
41
;------------------------------------------------------------------------------;
@@ -79,7 +93,7 @@ define i32 @n4(i32 %x, i32 %y) {
79
93
; CHECK-NEXT: ret i32 [[T1]]
80
94
;
81
95
%t0 = xor i32 %x , -1
82
- %t1 = sub i32 %t0 , %y ; swapped
96
+ %t1 = sub i32 %t0 , %y ; swapped
83
97
ret i32 %t1
84
98
}
85
99
@@ -89,7 +103,7 @@ define i32 @n5_is_not_not(i32 %x, i32 %y) {
89
103
; CHECK-NEXT: [[T1:%.*]] = add i32 [[T0_NEG]], [[Y:%.*]]
90
104
; CHECK-NEXT: ret i32 [[T1]]
91
105
;
92
- %t0 = xor i32 %x , 2147483647 ; not -1
106
+ %t0 = xor i32 %x , 2147483647 ; not -1
93
107
%t1 = sub i32 %y , %t0
94
108
ret i32 %t1
95
109
}
@@ -100,7 +114,7 @@ define <2 x i32> @n5_is_not_not_vec_splat(<2 x i32> %x, <2 x i32> %y) {
100
114
; CHECK-NEXT: [[T1:%.*]] = add <2 x i32> [[T0_NEG]], [[Y:%.*]]
101
115
; CHECK-NEXT: ret <2 x i32> [[T1]]
102
116
;
103
- %t0 = xor <2 x i32 > %x , <i32 2147483647 , i32 2147483647 > ; signmask, but not -1
117
+ %t0 = xor <2 x i32 > %x , <i32 2147483647 , i32 2147483647 > ; signmask, but not -1
104
118
%t1 = sub <2 x i32 > %y , %t0
105
119
ret <2 x i32 > %t1
106
120
}
0 commit comments