Skip to content

Commit

Permalink
NFC: The checks for AArch64 target features must be more flexible aft…
Browse files Browse the repository at this point in the history
…er Oliver Stannard's LLVM commit #78270

This is a preparation patch for ensuring LLVM18 compatibility
after the commit 13e977d changed how target feature dependencies
are handled.
  • Loading branch information
pawosm-arm committed Apr 3, 2024
1 parent 170c4f6 commit 52703ae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
5 changes: 3 additions & 2 deletions test/llvm_ir_correct/attr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ program tz
end do
print *, acc(100)
end program
! ATTRS-NOSVE: attributes{{.*}}"target-features"="+neon{{(,\+v8a)*}}"
! ATTRS-SVE: attributes{{.*}}"target-features"="+neon{{(,\+v8a)*}},+sve"
! ATTRS-NOSVE-NOT: attributes{{.*}}"target-features"="{{.*}}+sve{{.*}}"
! ATTRS-NOSVE: attributes{{.*}}"target-features"="{{.*}}+neon{{.*}}"
! ATTRS-SVE: attributes{{.*}}"target-features"="{{.*}}+sve{{.*}}"
18 changes: 9 additions & 9 deletions test/llvm_ir_correct/vscale-mbits.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ program tz
print *, acc(100)
end program
! ATTRS-SVE-128: attributes #{{[0-9]+}}
! ATTRS-SVE-128-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve"
! ATTRS-SVE-128-DAG: "target-features"="{{.*}}+sve{{.*}}"
! ATTRS-SVE-128-DAG: vscale_range(1,1)
! ATTRS-SVE-128PLUS: attributes #{{[0-9]+}}
! ATTRS-SVE-128PLUS-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve"
! ATTRS-SVE-128PLUS-DAG: "target-features"="{{.*}}+sve{{.*}}"
! ATTRS-SVE-128PLUS-DAG: vscale_range(1,0)
! ATTRS-SVE-256: attributes #{{[0-9]+}}
! ATTRS-SVE-256-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve"
! ATTRS-SVE-256-DAG: "target-features"="{{.*}}+sve{{.*}}"
! ATTRS-SVE-256-DAG: vscale_range(2,2)
! ATTRS-SVE-256PLUS: attributes #{{[0-9]+}}
! ATTRS-SVE-256PLUS-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve"
! ATTRS-SVE-256PLUS-DAG: "target-features"="{{.*}}+sve{{.*}}"
! ATTRS-SVE-256PLUS-DAG: vscale_range(2,0)
! ATTRS-SVE2-512: attributes #{{[0-9]+}}
! ATTRS-SVE2-512-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2,+sve"
! ATTRS-SVE2-512-DAG: "target-features"="{{.*}}+sve2{{.*}}"
! ATTRS-SVE2-512-DAG: vscale_range(4,4)
! ATTRS-SVE2-512PLUS: attributes #{{[0-9]+}}
! ATTRS-SVE2-512PLUS-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2,+sve"
! ATTRS-SVE2-512PLUS-DAG: "target-features"="{{.*}}+sve2{{.*}}"
! ATTRS-SVE2-512PLUS-DAG: vscale_range(4,0)
! ATTRS-SVE2SHA3-2048: attributes #{{[0-9]+}}
! ATTRS-SVE2SHA3-2048-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2-sha3,+sve,+sve2"
! ATTRS-SVE2SHA3-2048-DAG: "target-features"="{{.*}}+sve2-sha3{{.*}}"
! ATTRS-SVE2SHA3-2048-DAG: vscale_range(16,16)
! ATTRS-SVE2SHA3-2048PLUS: attributes #{{[0-9]+}}
! ATTRS-SVE2SHA3-2048PLUS-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2-sha3,+sve,+sve2"
! ATTRS-SVE2SHA3-2048PLUS-DAG: "target-features"="{{.*}}+sve2-sha3{{.*}}"
! ATTRS-SVE2SHA3-2048PLUS-DAG: vscale_range(16,0)
! ATTRS-SVE2-SCALABLE: attributes #{{[0-9]+}}
! ATTRS-SVE2-SCALABLE-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2,+sve"
! ATTRS-SVE2-SCALABLE-DAG: "target-features"="{{.*}}+sve2{{.*}}"
! ATTRS-SVE2-SCALABLE-DAG: vscale_range(1,16)
21 changes: 13 additions & 8 deletions test/llvm_ir_correct/vscale.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,28 @@ program tz
print *, acc(100)
end program
! ATTRS-NEON-NOT: vscale_range
! ATTRS-NEON: attributes{{.*}}"target-features"="+neon{{(,\+v8a)*}}"
! ATTRS-NEON: attributes{{.*}}"target-features"="{{.*}}+neon{{.*}}"
! ATTRS-SVE: attributes #{{[0-9]+}}
! ATTRS-SVE-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve"
! ATTRS-SVE-NOT: "target-features"="{{.*}}+sve2{{.*}}"
! ATTRS-SVE-DAG: "target-features"="{{.*}}+sve{{.*}}"
! ATTRS-SVE-DAG: vscale_range(1,16)
! ATTRS-SVE2: attributes #{{[0-9]+}}
! ATTRS-SVE2-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2,+sve"
! ATTRS-SVE2-DAG: "target-features"="{{.*}}+sve2{{.*}}"
! ATTRS-SVE2-DAG: vscale_range(1,16)
! ATTRS-SVE2SHA3: attributes #{{[0-9]+}}
! ATTRS-SVE2SHA3-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2-sha3,+sve,+sve2"
! ATTRS-SVE2SHA3-DAG: "target-features"="{{.*}}+sve2-sha3{{.*}}"
! ATTRS-SVE2SHA3-DAG: vscale_range(1,16)
! ATTRS-SVE-NOSVE-NOT: vscale_range
! ATTRS-SVE-NOSVE: attributes{{.*}}"target-features"="+neon{{(,\+v8a)*}},-sve,-sve2,-sve2-bitperm,-sve2-sha3,-sve2-aes,-sve2-sm4"
! ATTRS-SVE-NOSVE-NOT: attributes{{.*}}"target-features"{{.*}}+sve{{.*}}"
! ATTRS-SVE-NOSVE-DAG: attributes{{.*}}"target-features"{{.*}}+neon{{.*}}"
! ATTRS-SVE2-NOSVE2SHA3: attributes #{{[0-9]+}}
! ATTRS-SVE2-NOSVE2SHA3-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve2,+sve,-sve2-sha3"
! ATTRS-SVE2-NOSVE2SHA3-NOT: "target-features"="{{.*}}+sve2-sha3{{.*}}"
! ATTRS-SVE2-NOSVE2SHA3-DAG: "target-features"="{{.*}}+sve2{{.*}}"
! ATTRS-SVE2-NOSVE2SHA3-DAG: vscale_range(1,16)
! ATTRS-SVE2SHA3-NOSVE2: attributes #{{[0-9]+}}
! ATTRS-SVE2SHA3-NOSVE2-DAG: "target-features"="+neon{{(,\+v8a)*}},+sve,-sve2,-sve2-bitperm,-sve2-sha3,-sve2-aes,-sve2-sm4"
! ATTRS-SVE2SHA3-NOSVE2-NOT: "target-features"="{{.*}}+sve2{{.*}}"
! ATTRS-SVE2SHA3-NOSVE2-NOT: "target-features"="{{.*}}+sve2-sha3{{.*}}"
! ATTRS-SVE2SHA3-NOSVE2-DAG: "target-features"="{{.*}}+sve{{.*}}"
! ATTRS-SVE2SHA3-NOSVE2-DAG: vscale_range(1,16)
! ATTRS-SVE2SHA3-NOSVE-NOT: vscale_range
! ATTRS-SVE2SHA3-NOSVE: attributes{{.*}}"target-features"="+neon{{(,\+v8a)*}},-sve,-sve2,-sve2-bitperm,-sve2-sha3,-sve2-aes,-sve2-sm4"
! ATTRS-SVE2SHA3-NOSVE: attributes{{.*}}"target-features"="{{.*}}-sve2-sha3{{.*}}"

0 comments on commit 52703ae

Please sign in to comment.