@@ -379,3 +379,40 @@ entry:
379
379
%c = icmp ugt i64 %neg2 , 0
380
380
ret i1 %c
381
381
}
382
+
383
+ ; FIXME: currently this incorrectly simplifies %c4 to true.
384
+ define i1 @pr76713 (i16 %i1 , i16 %i3 ) {
385
+ ; CHECK-LABEL: @pr76713(
386
+ ; CHECK-NEXT: entry:
387
+ ; CHECK-NEXT: [[C1:%.*]] = icmp ult i16 [[I1:%.*]], -1
388
+ ; CHECK-NEXT: [[C2:%.*]] = icmp uge i16 [[I1]], -3
389
+ ; CHECK-NEXT: [[C3:%.*]] = icmp ult i16 [[I3:%.*]], 2
390
+ ; CHECK-NEXT: [[AND:%.*]] = and i1 [[C1]], [[C2]]
391
+ ; CHECK-NEXT: [[AND_2:%.*]] = and i1 [[AND]], [[C3]]
392
+ ; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
393
+ ; CHECK: then:
394
+ ; CHECK-NEXT: [[SUB:%.*]] = sub nuw nsw i16 [[I1]], -3
395
+ ; CHECK-NEXT: [[ARRAYIDX_IDX:%.*]] = mul nuw nsw i16 [[I3]], 4
396
+ ; CHECK-NEXT: [[I6:%.*]] = add nuw nsw i16 [[ARRAYIDX_IDX]], [[SUB]]
397
+ ; CHECK-NEXT: ret i1 true
398
+ ; CHECK: else:
399
+ ; CHECK-NEXT: ret i1 false
400
+ ;
401
+ entry:
402
+ %c1 = icmp ult i16 %i1 , -1
403
+ %c2 = icmp uge i16 %i1 , -3
404
+ %c3 = icmp ult i16 %i3 , 2
405
+ %and = and i1 %c1 , %c2
406
+ %and.2 = and i1 %and , %c3
407
+ br i1 %and , label %then , label %else
408
+
409
+ then:
410
+ %sub = sub nuw nsw i16 %i1 , -3
411
+ %arrayidx.idx = mul nuw nsw i16 %i3 , 4
412
+ %i6 = add nuw nsw i16 %arrayidx.idx , %sub
413
+ %c4 = icmp ult i16 12 , %i6
414
+ ret i1 %c4
415
+
416
+ else:
417
+ ret i1 0
418
+ }
0 commit comments