Skip to content

Commit

Permalink
NFC: With LLVM18 a loop preheader is being exposed, hence the preds m…
Browse files Browse the repository at this point in the history
…ust be more liberal

This is a preparation patch for ensuring LLVM18 compatibility.
  • Loading branch information
pawosm-arm authored and bryanpkc committed Apr 3, 2024
1 parent a3b01e2 commit 4b843fe
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test/directives/nounroll.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!
! RUN: %flang -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK
!
! CHECK: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]], %L.LB
! CHECK: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]]{{.*}}, %L.LB
! CHECK: store float
! CHECK-NOT: store float
! CHECK: br i1 {{.*}}, label %[[LOOP]], label %L.LB
Expand Down
2 changes: 1 addition & 1 deletion test/directives/nounroll2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
!
! RUN: %flang -O0 -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
!
! CHECK-O0: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[LOOP]], %L.LB
! CHECK-O0: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[LOOP]]{{.*}}, %L.LB
! CHECK-O0: store float
! CHECK-O0-NOT: store float
! CHECK-O0: br i1 {{.*}}, label %[[LOOP]], label %L.LB
Expand Down
8 changes: 4 additions & 4 deletions test/directives/unroll.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ subroutine func1(a, b)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK-O0: [[BB1:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB1]],
! CHECK-O0: [[BB1:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB1]]
! CHECK-O0: br i1 {{.*}}, label %[[BB1]]
! CHECK-O0-SAME: !llvm.loop [[MD_LOOP1:![0-9]+]]
! CHECK-O1-COUNT-10: store i32
! CHECK-O1-NOT: store i32
! CHECK-O1-NOT: br i1 {{.*}}, label %{{L.LB[0-9]_[0-9]+}}
! CHECK-O1-NOT: !llvm.loop !{{[0-9]+}}
! CHECK-O1: ret void
! CHECK-DISABLED: [[BB1:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB1]],
! CHECK-DISABLED: [[BB1:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB1]]
! CHECK-DISABLED: br i1 {{.*}}, label %[[BB1]]
end subroutine func1

Expand All @@ -49,7 +49,7 @@ subroutine func2(m, a, b)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK: [[BB2:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB2]],
! CHECK: [[BB2:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB2]]
! CHECK-O1-COUNT-4: store i32
! CHECK-O1-NOT: store i32
! CHECK: br i1 {{.*}}, label %[[BB2]]
Expand All @@ -66,7 +66,7 @@ subroutine func3(m, a, b)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK: [[BB3:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB3]],
! CHECK: [[BB3:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB3]]
! CHECK-O1-COUNT-7: store i32
! CHECK-O1-NOT: store i32
! CHECK: br i1 {{.*}}, label %[[BB3]]
Expand Down
6 changes: 3 additions & 3 deletions test/directives/unroll_override.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ subroutine func1(m, a, b)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK: [[BB1:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB1]],
! CHECK: [[BB1:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB1]]
! CHECK: br i1 {{.*}}, label %[[BB1]]
! CHECK-SAME: !llvm.loop [[MD_LOOP1:![0-9]+]]
end subroutine func1
Expand All @@ -32,7 +32,7 @@ subroutine func2(m, a, b)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK: [[BB2:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB2]],
! CHECK: [[BB2:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB2]]
! CHECK: br i1 {{.*}}, label %[[BB2]]
! CHECK-SAME: !llvm.loop [[MD_LOOP2:![0-9]+]]
end subroutine func2
Expand All @@ -47,7 +47,7 @@ subroutine func3(m, a, b)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK: [[BB3:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB3]],
! CHECK: [[BB3:L.LB[0-9]_[0-9]+]]:{{[ \t]+}}; preds = %[[BB3]]
! CHECK: br i1 {{.*}}, label %[[BB3]]
! CHECK-SAME: !llvm.loop [[MD_LOOP3:![0-9]+]]
end subroutine func3
Expand Down
4 changes: 2 additions & 2 deletions test/directives/vector_vectorlength_integer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subroutine func1(a, b, m)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK-00: [[LOOP:L.LB1_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]], %L.LB
! CHECK-00: [[LOOP:L.LB1_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]]{{.*}}, %L.LB
! CHECK-00: br i1 {{.*}}, label %[[LOOP]], {{.*}} !llvm.loop [[LOOP_LATCH_MD:![0-9]+]]
end subroutine func1

Expand All @@ -26,7 +26,7 @@ subroutine func2(a, b, m)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK-00: [[LOOP:L.LB2_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]], %L.LB
! CHECK-00: [[LOOP:L.LB2_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]]{{.*}}, %L.LB
! CHECK-00: br i1 {{.*}}, label %[[LOOP]], {{.*}} !llvm.loop [[LOOP_LATCH_MD2:![0-9]+]]
end subroutine func2

Expand Down
2 changes: 1 addition & 1 deletion test/directives/vector_vectorlength_num_fixed.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subroutine func1(a, b, m)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK-00: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]], %L.LB
! CHECK-00: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]]{{.*}}, %L.LB
! CHECK-00: br i1 {{.*}}, label %[[LOOP]], {{.*}} !llvm.loop [[LOOP_LATCH_MD:![0-9]+]]
end subroutine func1

Expand Down
2 changes: 1 addition & 1 deletion test/directives/vector_vectorlength_num_scalable.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subroutine func1(a, b, m)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK-00: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]], %L.LB
! CHECK-00: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]]{{.*}}, %L.LB
! CHECK-00: br i1 {{.*}}, label %[[LOOP]], {{.*}} !llvm.loop [[LOOP_LATCH_MD:![0-9]+]]
end subroutine func1

Expand Down
2 changes: 1 addition & 1 deletion test/directives/vector_vectorlength_scalable.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ subroutine func1(a, b, m)
do i = 1, m
b(i) = a(i) + 1
end do
! CHECK-00: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]], %L.LB
! CHECK-00: [[LOOP:L.LB[0-9]_[0-9]+]]:{{[' ',\t]+}}; preds = %[[LOOP]]{{.*}}, %L.LB
! CHECK-00: br i1 {{.*}}, label %[[LOOP]], {{.*}} !llvm.loop [[LOOP_LATCH_MD:![0-9]+]]
end subroutine func1

Expand Down

0 comments on commit 4b843fe

Please sign in to comment.