Commit 2f15a1a
Razvan Lupusoru
[flang][acc] Add infrastructure and tests for ACCImplicitData
This PR adds the necessary infrastructure to enable testing of
the ACCImplicitData pass for FIR/HLFIR, along with comprehensive
test coverage for implicit data clause generation in OpenACC
constructs.
New Infrastructure:
- Add FIROpenACCSupport analysis providing FIR-specific
implementations of OpenACCSupport interface methods for variable
name extraction, recipe name generation, and NYI emission
- Add FIROpenACCUtils with helper functions for:
* Variable name extraction from FIR operations
(getVariableName)
* Recipe name generation with FIR type string representation
* Bounds checking for constant array sections
- Add ACCInitializeFIRAnalyses pass to pre-register FIR analyses
(OpenACCSupport and AliasAnalysis) for use by subsequent
OpenACC passes in the pipeline
Refactoring in flang/lib/Lower/OpenACC.cpp:
- Move bounds string generation and bounds checking to
FIROpenACCUtils
- Refactor recipe name generation to use
fir::acc::getRecipeName
Test Coverage:
- acc-implicit-firstprivate.fir: Tests implicit firstprivate
behavior for scalar types (i8, i16, i32, i64, f32, f64,
logical, complex) in parallel/serial constructs with recipe
generation verification
- acc-implicit-data.fir: Tests implicit data clauses for
scalars, arrays, derived types, and boxes in
kernels/parallel/serial with default(none) and
default(present) variations
- acc-implicit-data-fortran.F90: Fortran tests verifying implicit
data generation through bbc with both HLFIR and FIR
- acc-implicit-data-derived-type-member.F90: Tests correct
ordering of parent/child data clause operations for derived
type members
- acc-implicit-copy-reduction.fir: Tests
enable-implicit-reduction-copy flag controlling whether
reduction variables use copy or firstprivate
This enables proper testing of implicit data clause generation
through the flang optimizer pipeline for OpenACC directives.1 parent fa050ea commit 2f15a1a
File tree
17 files changed
+1432
-58
lines changed- flang
- include/flang/Optimizer/OpenACC
- Analysis
- Support
- lib
- Lower
- Optimizer/OpenACC
- Analysis
- Support
- Transforms
- test/Transforms/OpenACC
17 files changed
+1432
-58
lines changedLines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
14 | 30 | | |
15 | 31 | | |
16 | 32 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
1159 | 1160 | | |
1160 | 1161 | | |
1161 | 1162 | | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | 1163 | | |
1175 | 1164 | | |
1176 | 1165 | | |
| |||
1207 | 1196 | | |
1208 | 1197 | | |
1209 | 1198 | | |
1210 | | - | |
| 1199 | + | |
1211 | 1200 | | |
1212 | 1201 | | |
1213 | 1202 | | |
| |||
1274 | 1263 | | |
1275 | 1264 | | |
1276 | 1265 | | |
1277 | | - | |
| 1266 | + | |
1278 | 1267 | | |
1279 | 1268 | | |
1280 | 1269 | | |
| |||
1358 | 1347 | | |
1359 | 1348 | | |
1360 | 1349 | | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | 1350 | | |
1389 | 1351 | | |
1390 | 1352 | | |
| |||
1458 | 1420 | | |
1459 | 1421 | | |
1460 | 1422 | | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
| 1423 | + | |
| 1424 | + | |
1464 | 1425 | | |
1465 | 1426 | | |
1466 | 1427 | | |
| |||
1474 | 1435 | | |
1475 | 1436 | | |
1476 | 1437 | | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
| 1438 | + | |
| 1439 | + | |
1481 | 1440 | | |
1482 | 1441 | | |
1483 | 1442 | | |
| |||
1829 | 1788 | | |
1830 | 1789 | | |
1831 | 1790 | | |
1832 | | - | |
| 1791 | + | |
1833 | 1792 | | |
1834 | 1793 | | |
1835 | 1794 | | |
| |||
1911 | 1870 | | |
1912 | 1871 | | |
1913 | 1872 | | |
1914 | | - | |
| 1873 | + | |
1915 | 1874 | | |
1916 | 1875 | | |
1917 | 1876 | | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
| 1877 | + | |
| 1878 | + | |
1923 | 1879 | | |
1924 | 1880 | | |
1925 | 1881 | | |
| |||
2164 | 2120 | | |
2165 | 2121 | | |
2166 | 2122 | | |
2167 | | - | |
2168 | | - | |
2169 | | - | |
| 2123 | + | |
| 2124 | + | |
2170 | 2125 | | |
2171 | 2126 | | |
2172 | 2127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments