[LVI] Regenerate test checks; NFC

This commit is contained in:
Nikita Popov 2019-04-29 21:12:38 +02:00
parent 11850a6305
commit 1cfe3e6df9
3 changed files with 100 additions and 56 deletions

View File

@ -1,8 +1,11 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S < %s -jump-threading | FileCheck %s ; RUN: opt -S < %s -jump-threading | FileCheck %s
; CHECK-LABEL: @foo
define void @foo() {
; CHECK-LABEL: define {{[^@]+}}@foo(
; CHECK-NEXT: exit2: ; CHECK-NEXT: exit2:
; CHECK-NEXT: ret void ; CHECK-NEXT: ret void
define void @foo() { ;
entry: entry:
br label %bb1 br label %bb1

View File

@ -1,3 +1,4 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -jump-threading < %s | FileCheck %s ; RUN: opt -S -jump-threading < %s | FileCheck %s
; Check that the heuristic for avoiding accidental introduction of irreducible ; Check that the heuristic for avoiding accidental introduction of irreducible
@ -7,7 +8,20 @@
declare void @opaque_body() declare void @opaque_body()
define void @jump_threading_loopheader() { define void @jump_threading_loopheader() {
; CHECK-LABEL: @jump_threading_loopheader ; CHECK-LABEL: define {{[^@]+}}@jump_threading_loopheader(
; CHECK-NEXT: top:
; CHECK-NEXT: br label [[ENTRY:%.*]]
; CHECK: entry:
; CHECK-NEXT: [[IND:%.*]] = phi i32 [ 0, [[TOP:%.*]] ], [ [[NEXTIND:%.*]], [[LATCH:%.*]] ]
; CHECK-NEXT: [[NEXTIND]] = add i32 [[IND]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ule i32 [[IND]], 10
; CHECK-NEXT: br i1 [[CMP]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: call void @opaque_body()
; CHECK-NEXT: br label [[ENTRY]]
; CHECK: exit:
; CHECK-NEXT: ret void
;
top: top:
br label %entry br label %entry
@ -15,12 +29,10 @@ entry:
%ind = phi i32 [0, %top], [%nextind, %latch] %ind = phi i32 [0, %top], [%nextind, %latch]
%nextind = add i32 %ind, 1 %nextind = add i32 %ind, 1
%cmp = icmp ule i32 %ind, 10 %cmp = icmp ule i32 %ind, 10
; CHECK: br i1 %cmp, label %latch, label %exit
br i1 %cmp, label %body, label %latch br i1 %cmp, label %body, label %latch
body: body:
call void @opaque_body() call void @opaque_body()
; CHECK: br label %entry
br label %latch br label %latch
latch: latch:
@ -41,7 +53,20 @@ exit:
; instruction because jump-threading relies on that to decide which edge to ; instruction because jump-threading relies on that to decide which edge to
; try to thread first. ; try to thread first.
define void @jump_threading_loopheader2() { define void @jump_threading_loopheader2() {
; CHECK-LABEL: @jump_threading_loopheader2 ; CHECK-LABEL: define {{[^@]+}}@jump_threading_loopheader2(
; CHECK-NEXT: top:
; CHECK-NEXT: br label [[ENTRY:%.*]]
; CHECK: entry:
; CHECK-NEXT: [[IND:%.*]] = phi i32 [ 0, [[TOP:%.*]] ], [ [[NEXTIND:%.*]], [[LATCH:%.*]] ]
; CHECK-NEXT: [[NEXTIND]] = add i32 [[IND]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ule i32 [[IND]], 10
; CHECK-NEXT: br i1 [[CMP]], label [[EXIT:%.*]], label [[LATCH]]
; CHECK: latch:
; CHECK-NEXT: br label [[ENTRY]]
; CHECK: exit:
; CHECK-NEXT: call void @opaque_body()
; CHECK-NEXT: ret void
;
top: top:
br label %entry br label %entry
@ -49,12 +74,10 @@ entry:
%ind = phi i32 [0, %top], [%nextind, %latch] %ind = phi i32 [0, %top], [%nextind, %latch]
%nextind = add i32 %ind, 1 %nextind = add i32 %ind, 1
%cmp = icmp ule i32 %ind, 10 %cmp = icmp ule i32 %ind, 10
; CHECK: br i1 %cmp, label %exit, label %latch
br i1 %cmp, label %body, label %latch br i1 %cmp, label %body, label %latch
body: body:
call void @opaque_body() call void @opaque_body()
; CHECK: br label %entry
br label %latch br label %latch
latch: latch:
@ -73,7 +96,20 @@ exit:
; Check if we can handle undef branch condition. ; Check if we can handle undef branch condition.
define void @jump_threading_loopheader3() { define void @jump_threading_loopheader3() {
; CHECK-LABEL: @jump_threading_loopheader3 ; CHECK-LABEL: define {{[^@]+}}@jump_threading_loopheader3(
; CHECK-NEXT: top:
; CHECK-NEXT: br label [[ENTRY:%.*]]
; CHECK: entry:
; CHECK-NEXT: [[IND:%.*]] = phi i32 [ 0, [[TOP:%.*]] ], [ [[NEXTIND:%.*]], [[LATCH:%.*]] ]
; CHECK-NEXT: [[NEXTIND]] = add i32 [[IND]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ule i32 [[IND]], 10
; CHECK-NEXT: br i1 [[CMP]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: call void @opaque_body()
; CHECK-NEXT: br label [[ENTRY]]
; CHECK: exit:
; CHECK-NEXT: ret void
;
top: top:
br label %entry br label %entry
@ -81,12 +117,10 @@ entry:
%ind = phi i32 [0, %top], [%nextind, %latch] %ind = phi i32 [0, %top], [%nextind, %latch]
%nextind = add i32 %ind, 1 %nextind = add i32 %ind, 1
%cmp = icmp ule i32 %ind, 10 %cmp = icmp ule i32 %ind, 10
; CHECK: br i1 %cmp, label %latch, label %exit
br i1 %cmp, label %body, label %latch br i1 %cmp, label %body, label %latch
body: body:
call void @opaque_body() call void @opaque_body()
; CHECK: br label %entry
br label %latch br label %latch
latch: latch:

View File

@ -1,15 +1,22 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -jump-threading < %s | FileCheck %s ; RUN: opt -S -jump-threading < %s | FileCheck %s
define i8 @test(i32 %a, i32 %length) { define i8 @test(i32 %a, i32 %length) {
; CHECK-LABEL: @test ; CHECK-LABEL: define {{[^@]+}}@test(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[BACKEDGE:%.*]]
; CHECK: backedge:
; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[BACKEDGE]] ]
; CHECK-NEXT: [[IV_NEXT]] = add nsw i32 [[IV]], 1
; CHECK-NEXT: [[CONT:%.*]] = icmp slt i32 [[IV_NEXT]], 400
; CHECK-NEXT: br i1 [[CONT]], label [[BACKEDGE]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: ret i8 0
;
entry: entry:
; CHECK: br label %backedge
br label %loop br label %loop
loop: loop:
; CHECK-LABEL: backedge:
; CHECK: phi i32
; CHECK: br i1 %cont, label %backedge, label %exit
%iv = phi i32 [0, %entry], [%iv.next, %backedge] %iv = phi i32 [0, %entry], [%iv.next, %backedge]
;; We can use an inductive argument to prove %iv is always positive ;; We can use an inductive argument to prove %iv is always positive
%cnd = icmp sge i32 %iv, 0 %cnd = icmp sge i32 %iv, 0