File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
test/Transforms/InstSimplify Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -9393,6 +9393,10 @@ static ConstantRange getRangeForIntrinsic(const IntrinsicInst &II) {
9393
9393
if (!II.getParent () || !II.getFunction ())
9394
9394
break ;
9395
9395
return getVScaleRange (II.getFunction (), Width);
9396
+ case Intrinsic::scmp:
9397
+ case Intrinsic::ucmp:
9398
+ return ConstantRange::getNonEmpty (APInt::getAllOnes (Width),
9399
+ APInt (Width, 2 ));
9396
9400
default :
9397
9401
break ;
9398
9402
}
Original file line number Diff line number Diff line change @@ -229,6 +229,26 @@ define <4 x i8> @ucmp_with_addition_vec(<4 x i32> %x) {
229
229
ret <4 x i8 > %2
230
230
}
231
231
232
+ define i1 @scmp_eq_4 (i32 %x , i32 %y ) {
233
+ ; CHECK-LABEL: define i1 @scmp_eq_4(
234
+ ; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
235
+ ; CHECK-NEXT: ret i1 false
236
+ ;
237
+ %1 = call i8 @llvm.scmp (i32 %x , i32 %y )
238
+ %2 = icmp eq i8 %1 , 4
239
+ ret i1 %2
240
+ }
241
+
242
+ define i1 @ucmp_ne_negative_2 (i32 %x , i32 %y ) {
243
+ ; CHECK-LABEL: define i1 @ucmp_ne_negative_2(
244
+ ; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
245
+ ; CHECK-NEXT: ret i1 true
246
+ ;
247
+ %1 = call i8 @llvm.ucmp (i32 %x , i32 %y )
248
+ %2 = icmp ne i8 %1 , -2
249
+ ret i1 %2
250
+ }
251
+
232
252
; Negative case: mismatched signedness of predicates
233
253
define i8 @scmp_known_ugt (i32 %x , i32 %y ) {
234
254
; CHECK-LABEL: define i8 @scmp_known_ugt(
You can’t perform that action at this time.
0 commit comments