llvm.org GIT mirror llvm / 6dfa176
[Tests] Better represent the postinc form produced by LFTR in LoopPred tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362270 91177308-0d34-0410-b5e6-96231b3b80d8 Philip Reames 3 months ago
1 changed file(s) with 12 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
16011601 ; CHECK-LABEL: @ne_latch_zext(
16021602 ; CHECK-NEXT: loop.preheader:
16031603 ; CHECK-NEXT: [[N:%.*]] = zext i16 [[N16:%.*]] to i32
1604 ; CHECK-NEXT: [[NPLUS1:%.*]] = add nuw nsw i32 [[N]], 1
16041605 ; CHECK-NEXT: br label [[LOOP:%.*]]
16051606 ; CHECK: loop:
16061607 ; CHECK-NEXT: [[I:%.*]] = phi i32 [ [[I_NEXT:%.*]], [[LOOP]] ], [ 0, [[LOOP_PREHEADER:%.*]] ]
16071608 ; CHECK-NEXT: [[WITHIN_BOUNDS:%.*]] = icmp ult i32 [[I]], [[LENGTH:%.*]]
16081609 ; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[WITHIN_BOUNDS]], i32 9) [ "deopt"() ]
1609 ; CHECK-NEXT: [[I_NEXT]] = add nuw i32 [[I]], 1
1610 ; CHECK-NEXT: [[CONTINUE:%.*]] = icmp ne i32 [[I_NEXT]], [[N]]
1610 ; CHECK-NEXT: [[I_NEXT]] = add nuw nsw i32 [[I]], 1
1611 ; CHECK-NEXT: [[CONTINUE:%.*]] = icmp ne i32 [[I_NEXT]], [[NPLUS1]]
16111612 ; CHECK-NEXT: br i1 [[CONTINUE]], label [[LOOP]], label [[EXIT:%.*]]
16121613 ; CHECK: exit:
16131614 ; CHECK-NEXT: ret i32 0
16141615 ;
16151616 loop.preheader:
16161617 %n = zext i16 %n16 to i32
1618 %nplus1 = add nsw nuw i32 %n, 1
16171619 br label %loop
16181620
16191621 loop:
16211623 %within.bounds = icmp ult i32 %i, %length
16221624 call void (i1, ...) @llvm.experimental.guard(i1 %within.bounds, i32 9) [ "deopt"() ]
16231625
1624 %i.next = add nuw i32 %i, 1
1625 %continue = icmp ne i32 %i.next, %n
1626 %i.next = add nsw nuw i32 %i, 1
1627 %continue = icmp ne i32 %i.next, %nplus1
16261628 br i1 %continue, label %loop, label %exit
16271629
16281630 exit:
16681670 ; CHECK-LABEL: @ne_latch_dom_check(
16691671 ; CHECK-NEXT: entry:
16701672 ; CHECK-NEXT: [[TMP5:%.*]] = icmp sle i32 [[N:%.*]], 0
1673 ; CHECK-NEXT: [[NPLUS1:%.*]] = add nuw i32 [[N]], 1
16711674 ; CHECK-NEXT: br i1 [[TMP5]], label [[EXIT:%.*]], label [[LOOP_PREHEADER:%.*]]
16721675 ; CHECK: loop.preheader:
16731676 ; CHECK-NEXT: br label [[LOOP:%.*]]
16751678 ; CHECK-NEXT: [[I:%.*]] = phi i32 [ [[I_NEXT:%.*]], [[LOOP]] ], [ 0, [[LOOP_PREHEADER]] ]
16761679 ; CHECK-NEXT: [[WITHIN_BOUNDS:%.*]] = icmp ult i32 [[I]], [[LENGTH:%.*]]
16771680 ; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[WITHIN_BOUNDS]], i32 9) [ "deopt"() ]
1678 ; CHECK-NEXT: [[I_NEXT]] = add nuw i32 [[I]], 1
1679 ; CHECK-NEXT: [[CONTINUE:%.*]] = icmp ne i32 [[I_NEXT]], [[N]]
1681 ; CHECK-NEXT: [[I_NEXT]] = add nuw nsw i32 [[I]], 1
1682 ; CHECK-NEXT: [[CONTINUE:%.*]] = icmp ne i32 [[I_NEXT]], [[NPLUS1]]
16801683 ; CHECK-NEXT: br i1 [[CONTINUE]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
16811684 ; CHECK: exit.loopexit:
16821685 ; CHECK-NEXT: br label [[EXIT]]
16851688 ;
16861689 entry:
16871690 %tmp5 = icmp sle i32 %n, 0
1691 %nplus1 = add nuw i32 %n, 1
16881692 br i1 %tmp5, label %exit, label %loop.preheader
16891693
16901694 loop.preheader:
16951699 %within.bounds = icmp ult i32 %i, %length
16961700 call void (i1, ...) @llvm.experimental.guard(i1 %within.bounds, i32 9) [ "deopt"() ]
16971701
1698 %i.next = add nuw i32 %i, 1
1699 %continue = icmp ne i32 %i.next, %n
1702 %i.next = add nsw nuw i32 %i, 1
1703 %continue = icmp ne i32 %i.next, %nplus1
17001704 br i1 %continue, label %loop, label %exit
17011705
17021706 exit: