Skip to content

Commit 01bde73

Browse files
committed
[CVP] Remove unnecessary block splits in tests (NFC)
These are no longer necessary since D69686.
1 parent fe79061 commit 01bde73

File tree

7 files changed

+70
-412
lines changed

7 files changed

+70
-412
lines changed

llvm/test/Transforms/CorrelatedValuePropagation/basic.ll

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -280,30 +280,20 @@ next:
280280

281281
define i1 @arg_attribute(i8* nonnull %a) {
282282
; CHECK-LABEL: @arg_attribute(
283-
; CHECK-NEXT: br label [[EXIT:%.*]]
284-
; CHECK: exit:
285283
; CHECK-NEXT: ret i1 false
286284
;
287285
%cmp = icmp eq i8* %a, null
288-
br label %exit
289-
290-
exit:
291286
ret i1 %cmp
292287
}
293288

294289
declare nonnull i8* @return_nonnull()
295290
define i1 @call_attribute() {
296291
; CHECK-LABEL: @call_attribute(
297292
; CHECK-NEXT: [[A:%.*]] = call i8* @return_nonnull()
298-
; CHECK-NEXT: br label [[EXIT:%.*]]
299-
; CHECK: exit:
300293
; CHECK-NEXT: ret i1 false
301294
;
302295
%a = call i8* @return_nonnull()
303296
%cmp = icmp eq i8* %a, null
304-
br label %exit
305-
306-
exit:
307297
ret i1 %cmp
308298
}
309299

@@ -318,8 +308,6 @@ define i1 @umin(i32 %a, i32 %b) {
318308
; CHECK: b_guard:
319309
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp ult i32 [[A]], [[B]]
320310
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 [[B]]
321-
; CHECK-NEXT: br label [[NEXT:%.*]]
322-
; CHECK: next:
323311
; CHECK-NEXT: ret i1 false
324312
; CHECK: out:
325313
; CHECK-NEXT: ret i1 false
@@ -336,8 +324,6 @@ b_guard:
336324
%sel_cmp = icmp ult i32 %a, %b
337325
%min = select i1 %sel_cmp, i32 %a, i32 %b
338326
%res = icmp eq i32 %min, 7
339-
br label %next
340-
next:
341327
ret i1 %res
342328
out:
343329
ret i1 false
@@ -354,8 +340,6 @@ define i1 @smin(i32 %a, i32 %b) {
354340
; CHECK: b_guard:
355341
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp sle i32 [[A]], [[B]]
356342
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 [[B]]
357-
; CHECK-NEXT: br label [[NEXT:%.*]]
358-
; CHECK: next:
359343
; CHECK-NEXT: ret i1 false
360344
; CHECK: out:
361345
; CHECK-NEXT: ret i1 false
@@ -372,8 +356,6 @@ b_guard:
372356
%sel_cmp = icmp sle i32 %a, %b
373357
%min = select i1 %sel_cmp, i32 %a, i32 %b
374358
%res = icmp eq i32 %min, 7
375-
br label %next
376-
next:
377359
ret i1 %res
378360
out:
379361
ret i1 false
@@ -390,8 +372,6 @@ define i1 @smax(i32 %a, i32 %b) {
390372
; CHECK: b_guard:
391373
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp sge i32 [[A]], [[B]]
392374
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 [[B]]
393-
; CHECK-NEXT: br label [[NEXT:%.*]]
394-
; CHECK: next:
395375
; CHECK-NEXT: ret i1 false
396376
; CHECK: out:
397377
; CHECK-NEXT: ret i1 false
@@ -408,8 +388,6 @@ b_guard:
408388
%sel_cmp = icmp sge i32 %a, %b
409389
%max = select i1 %sel_cmp, i32 %a, i32 %b
410390
%res = icmp eq i32 %max, 7
411-
br label %next
412-
next:
413391
ret i1 %res
414392
out:
415393
ret i1 false
@@ -426,8 +404,6 @@ define i1 @umax(i32 %a, i32 %b) {
426404
; CHECK: b_guard:
427405
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp uge i32 [[A]], [[B]]
428406
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 [[B]]
429-
; CHECK-NEXT: br label [[NEXT:%.*]]
430-
; CHECK: next:
431407
; CHECK-NEXT: ret i1 false
432408
; CHECK: out:
433409
; CHECK-NEXT: ret i1 false
@@ -444,8 +420,6 @@ b_guard:
444420
%sel_cmp = icmp uge i32 %a, %b
445421
%max = select i1 %sel_cmp, i32 %a, i32 %b
446422
%res = icmp eq i32 %max, 7
447-
br label %next
448-
next:
449423
ret i1 %res
450424
out:
451425
ret i1 false
@@ -460,8 +434,6 @@ define i1 @clamp_low1(i32 %a) {
460434
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp eq i32 [[A]], 5
461435
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], -1
462436
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 5, i32 [[A]]
463-
; CHECK-NEXT: br label [[NEXT:%.*]]
464-
; CHECK: next:
465437
; CHECK-NEXT: ret i1 false
466438
; CHECK: out:
467439
; CHECK-NEXT: ret i1 false
@@ -475,8 +447,6 @@ a_guard:
475447
%add = add i32 %a, -1
476448
%sel = select i1 %sel_cmp, i32 5, i32 %a
477449
%res = icmp eq i32 %sel, 4
478-
br label %next
479-
next:
480450
ret i1 %res
481451
out:
482452
ret i1 false
@@ -491,8 +461,6 @@ define i1 @clamp_low2(i32 %a) {
491461
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp ne i32 [[A]], 5
492462
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], -1
493463
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 5
494-
; CHECK-NEXT: br label [[NEXT:%.*]]
495-
; CHECK: next:
496464
; CHECK-NEXT: ret i1 false
497465
; CHECK: out:
498466
; CHECK-NEXT: ret i1 false
@@ -506,8 +474,6 @@ a_guard:
506474
%add = add i32 %a, -1
507475
%sel = select i1 %sel_cmp, i32 %a, i32 5
508476
%res = icmp eq i32 %sel, 4
509-
br label %next
510-
next:
511477
ret i1 %res
512478
out:
513479
ret i1 false
@@ -522,8 +488,6 @@ define i1 @clamp_high1(i32 %a) {
522488
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp eq i32 [[A]], 5
523489
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], 1
524490
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 5, i32 [[A]]
525-
; CHECK-NEXT: br label [[NEXT:%.*]]
526-
; CHECK: next:
527491
; CHECK-NEXT: ret i1 false
528492
; CHECK: out:
529493
; CHECK-NEXT: ret i1 false
@@ -537,8 +501,6 @@ a_guard:
537501
%add = add i32 %a, 1
538502
%sel = select i1 %sel_cmp, i32 5, i32 %a
539503
%res = icmp eq i32 %sel, 6
540-
br label %next
541-
next:
542504
ret i1 %res
543505
out:
544506
ret i1 false
@@ -553,8 +515,6 @@ define i1 @clamp_high2(i32 %a) {
553515
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp ne i32 [[A]], 5
554516
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], 1
555517
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 5
556-
; CHECK-NEXT: br label [[NEXT:%.*]]
557-
; CHECK: next:
558518
; CHECK-NEXT: ret i1 false
559519
; CHECK: out:
560520
; CHECK-NEXT: ret i1 false
@@ -568,8 +528,6 @@ a_guard:
568528
%add = add i32 %a, 1
569529
%sel = select i1 %sel_cmp, i32 %a, i32 5
570530
%res = icmp eq i32 %sel, 6
571-
br label %next
572-
next:
573531
ret i1 %res
574532
out:
575533
ret i1 false
@@ -585,8 +543,6 @@ define i1 @clamp_high3(i32 %a) {
585543
; CHECK-NEXT: [[SEL_CMP:%.*]] = icmp ne i32 [[A]], 5
586544
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[A]], 100
587545
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[SEL_CMP]], i32 [[A]], i32 5
588-
; CHECK-NEXT: br label [[NEXT:%.*]]
589-
; CHECK: next:
590546
; CHECK-NEXT: ret i1 false
591547
; CHECK: out:
592548
; CHECK-NEXT: ret i1 false
@@ -600,8 +556,6 @@ a_guard:
600556
%add = add i32 %a, 100
601557
%sel = select i1 %sel_cmp, i32 %a, i32 5
602558
%res = icmp eq i32 %sel, 105
603-
br label %next
604-
next:
605559
ret i1 %res
606560
out:
607561
ret i1 false
@@ -618,8 +572,6 @@ define void @abs1(i32 %a, i1* %p) {
618572
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 0, [[A]]
619573
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[A]], 0
620574
; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[SUB]], i32 [[A]]
621-
; CHECK-NEXT: br label [[SPLIT:%.*]]
622-
; CHECK: split:
623575
; CHECK-NEXT: store i1 true, i1* [[P:%.*]], align 1
624576
; CHECK-NEXT: [[C2:%.*]] = icmp slt i32 [[ABS]], 19
625577
; CHECK-NEXT: store i1 [[C2]], i1* [[P]], align 1
@@ -640,9 +592,6 @@ guard:
640592
%sub = sub i32 0, %a
641593
%cmp = icmp slt i32 %a, 0
642594
%abs = select i1 %cmp, i32 %sub, i32 %a
643-
br label %split
644-
645-
split:
646595
%c1 = icmp slt i32 %abs, 20
647596
store i1 %c1, i1* %p
648597
%c2 = icmp slt i32 %abs, 19
@@ -668,8 +617,6 @@ define void @abs2(i32 %a, i1* %p) {
668617
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 0, [[A]]
669618
; CHECK-NEXT: [[CMP:%.*]] = icmp sge i32 [[A]], 0
670619
; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[A]], i32 [[SUB]]
671-
; CHECK-NEXT: br label [[SPLIT:%.*]]
672-
; CHECK: split:
673620
; CHECK-NEXT: store i1 true, i1* [[P:%.*]], align 1
674621
; CHECK-NEXT: [[C2:%.*]] = icmp slt i32 [[ABS]], 19
675622
; CHECK-NEXT: store i1 [[C2]], i1* [[P]], align 1
@@ -690,9 +637,6 @@ guard:
690637
%sub = sub i32 0, %a
691638
%cmp = icmp sge i32 %a, 0
692639
%abs = select i1 %cmp, i32 %a, i32 %sub
693-
br label %split
694-
695-
split:
696640
%c1 = icmp slt i32 %abs, 20
697641
store i1 %c1, i1* %p
698642
%c2 = icmp slt i32 %abs, 19
@@ -718,8 +662,6 @@ define void @nabs1(i32 %a, i1* %p) {
718662
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 0, [[A]]
719663
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0
720664
; CHECK-NEXT: [[NABS:%.*]] = select i1 [[CMP]], i32 [[SUB]], i32 [[A]]
721-
; CHECK-NEXT: br label [[SPLIT:%.*]]
722-
; CHECK: split:
723665
; CHECK-NEXT: store i1 true, i1* [[P:%.*]], align 1
724666
; CHECK-NEXT: [[C2:%.*]] = icmp sgt i32 [[NABS]], -19
725667
; CHECK-NEXT: store i1 [[C2]], i1* [[P]], align 1
@@ -740,9 +682,6 @@ guard:
740682
%sub = sub i32 0, %a
741683
%cmp = icmp sgt i32 %a, 0
742684
%nabs = select i1 %cmp, i32 %sub, i32 %a
743-
br label %split
744-
745-
split:
746685
%c1 = icmp sgt i32 %nabs, -20
747686
store i1 %c1, i1* %p
748687
%c2 = icmp sgt i32 %nabs, -19
@@ -768,8 +707,6 @@ define void @nabs2(i32 %a, i1* %p) {
768707
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 0, [[A]]
769708
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[A]], 0
770709
; CHECK-NEXT: [[NABS:%.*]] = select i1 [[CMP]], i32 [[A]], i32 [[SUB]]
771-
; CHECK-NEXT: br label [[SPLIT:%.*]]
772-
; CHECK: split:
773710
; CHECK-NEXT: store i1 true, i1* [[P:%.*]], align 1
774711
; CHECK-NEXT: [[C2:%.*]] = icmp sgt i32 [[NABS]], -19
775712
; CHECK-NEXT: store i1 [[C2]], i1* [[P]], align 1
@@ -790,9 +727,6 @@ guard:
790727
%sub = sub i32 0, %a
791728
%cmp = icmp slt i32 %a, 0
792729
%nabs = select i1 %cmp, i32 %a, i32 %sub
793-
br label %split
794-
795-
split:
796730
%c1 = icmp sgt i32 %nabs, -20
797731
store i1 %c1, i1* %p
798732
%c2 = icmp sgt i32 %nabs, -19
@@ -811,15 +745,11 @@ define i1 @zext_unknown(i8 %a) {
811745
; CHECK-LABEL: @zext_unknown(
812746
; CHECK-NEXT: entry:
813747
; CHECK-NEXT: [[A32:%.*]] = zext i8 [[A:%.*]] to i32
814-
; CHECK-NEXT: br label [[EXIT:%.*]]
815-
; CHECK: exit:
816748
; CHECK-NEXT: ret i1 true
817749
;
818750
entry:
819751
%a32 = zext i8 %a to i32
820752
%cmp = icmp sle i32 %a32, 256
821-
br label %exit
822-
exit:
823753
ret i1 %cmp
824754
}
825755

@@ -828,16 +758,12 @@ define i1 @trunc_unknown(i32 %a) {
828758
; CHECK-NEXT: entry:
829759
; CHECK-NEXT: [[A8:%.*]] = trunc i32 [[A:%.*]] to i8
830760
; CHECK-NEXT: [[A32:%.*]] = sext i8 [[A8]] to i32
831-
; CHECK-NEXT: br label [[EXIT:%.*]]
832-
; CHECK: exit:
833761
; CHECK-NEXT: ret i1 true
834762
;
835763
entry:
836764
%a8 = trunc i32 %a to i8
837765
%a32 = sext i8 %a8 to i32
838766
%cmp = icmp sle i32 %a32, 128
839-
br label %exit
840-
exit:
841767
ret i1 %cmp
842768
}
843769

@@ -848,15 +774,11 @@ define i1 @bitcast_unknown(float %a) {
848774
; CHECK-NEXT: entry:
849775
; CHECK-NEXT: [[A32:%.*]] = bitcast float [[A:%.*]] to i32
850776
; CHECK-NEXT: [[CMP:%.*]] = icmp sle i32 [[A32]], 128
851-
; CHECK-NEXT: br label [[EXIT:%.*]]
852-
; CHECK: exit:
853777
; CHECK-NEXT: ret i1 [[CMP]]
854778
;
855779
entry:
856780
%a32 = bitcast float %a to i32
857781
%cmp = icmp sle i32 %a32, 128
858-
br label %exit
859-
exit:
860782
ret i1 %cmp
861783
}
862784

@@ -865,15 +787,11 @@ define i1 @bitcast_unknown2(i8* %p) {
865787
; CHECK-NEXT: entry:
866788
; CHECK-NEXT: [[P64:%.*]] = ptrtoint i8* [[P:%.*]] to i64
867789
; CHECK-NEXT: [[CMP:%.*]] = icmp sle i64 [[P64]], 128
868-
; CHECK-NEXT: br label [[EXIT:%.*]]
869-
; CHECK: exit:
870790
; CHECK-NEXT: ret i1 [[CMP]]
871791
;
872792
entry:
873793
%p64 = ptrtoint i8* %p to i64
874794
%cmp = icmp sle i64 %p64, 128
875-
br label %exit
876-
exit:
877795
ret i1 %cmp
878796
}
879797

@@ -882,47 +800,35 @@ define i1 @and_unknown(i32 %a) {
882800
; CHECK-LABEL: @and_unknown(
883801
; CHECK-NEXT: entry:
884802
; CHECK-NEXT: [[AND:%.*]] = and i32 [[A:%.*]], 128
885-
; CHECK-NEXT: br label [[EXIT:%.*]]
886-
; CHECK: exit:
887803
; CHECK-NEXT: ret i1 true
888804
;
889805
entry:
890806
%and = and i32 %a, 128
891807
%cmp = icmp sle i32 %and, 128
892-
br label %exit
893-
exit:
894808
ret i1 %cmp
895809
}
896810

897811
define i1 @lshr_unknown(i32 %a) {
898812
; CHECK-LABEL: @lshr_unknown(
899813
; CHECK-NEXT: entry:
900814
; CHECK-NEXT: [[AND:%.*]] = lshr i32 [[A:%.*]], 30
901-
; CHECK-NEXT: br label [[EXIT:%.*]]
902-
; CHECK: exit:
903815
; CHECK-NEXT: ret i1 true
904816
;
905817
entry:
906818
%and = lshr i32 %a, 30
907819
%cmp = icmp sle i32 %and, 128
908-
br label %exit
909-
exit:
910820
ret i1 %cmp
911821
}
912822

913823
define i1 @urem_unknown(i32 %a) {
914824
; CHECK-LABEL: @urem_unknown(
915825
; CHECK-NEXT: entry:
916826
; CHECK-NEXT: [[UREM:%.*]] = urem i32 [[A:%.*]], 30
917-
; CHECK-NEXT: br label [[EXIT:%.*]]
918-
; CHECK: exit:
919827
; CHECK-NEXT: ret i1 true
920828
;
921829
entry:
922830
%urem = urem i32 %a, 30
923831
%cmp = icmp ult i32 %urem, 30
924-
br label %exit
925-
exit:
926832
ret i1 %cmp
927833
}
928834

0 commit comments

Comments
 (0)