aboutsummaryrefslogtreecommitdiff
path: root/gcc/ChangeLog.omp
blob: 9a09a98e621de8b891c57e4bbcd98d1e436ca6b3 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
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
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
2024-03-04  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-03-01  Jakub Jelinek  <jakub@redhat.com>
		    Tobias Burnus  <tburnus@baylibre.com>

	PR c++/110347
	* gimplify.cc (omp_notice_variable): Fix 'shared' arg to
	lang_hooks.decls.omp_disregard_value_expr for
	(first)private in target regions.

2023-11-28  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.cc (gcn_vectorize_vec_perm_const): Disallow TImode.

2023-11-28  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-valu.md (*mov<mode>_4reg): Disparage AVGPR use when a
	reload is required.

2023-11-28  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/constraints.md: Add "a" AVGPR constraint.
	* config/gcn/gcn-valu.md (*mov<mode>): Add AVGPR alternatives.
	(*mov<mode>_4reg): Likewise.
	(@mov<mode>_sgprbase): Likewise.
	(gather<mode>_insn_1offset<exec>): Likewise.
	(gather<mode>_insn_1offset_ds<exec>): Likewise.
	(gather<mode>_insn_2offsets<exec>): Likewise.
	(scatter<mode>_expr<exec_scatter>): Likewise.
	(scatter<mode>_insn_1offset_ds<exec_scatter>): Likewise.
	(scatter<mode>_insn_2offsets<exec_scatter>): Likewise.
	* config/gcn/gcn.cc (MAX_NORMAL_AVGPR_COUNT): Define.
	(gcn_class_max_nregs): Handle AVGPR_REGS and ALL_VGPR_REGS.
	(gcn_hard_regno_mode_ok): Likewise.
	(gcn_regno_reg_class): Likewise.
	(gcn_spill_class): Allow spilling to AVGPRs on TARGET_CDNA1_PLUS.
	(gcn_sgpr_move_p): Handle AVGPRs.
	(gcn_secondary_reload): Reload AVGPRs via VGPRs.
	(gcn_conditional_register_usage): Handle AVGPRs.
	(gcn_vgpr_equivalent_register_operand): New function.
	(gcn_valid_move_p): Check for validity of AVGPR moves.
	(gcn_compute_frame_offsets): Handle AVGPRs.
	(gcn_memory_move_cost): Likewise.
	(gcn_register_move_cost): Likewise.
	(gcn_vmem_insn_p): Handle TYPE_VOP3P_MAI.
	(gcn_md_reorg): Handle AVGPRs.
	(gcn_hsa_declare_function_name): Likewise.
	(print_reg): Likewise.
	(gcn_dwarf_register_number): Likewise.
	* config/gcn/gcn.h (FIRST_AVGPR_REG): Define.
	(AVGPR_REGNO): Define.
	(LAST_AVGPR_REG): Define.
	(SOFT_ARG_REG): Update.
	(FRAME_POINTER_REGNUM): Update.
	(DWARF_LINK_REGISTER): Update.
	(FIRST_PSEUDO_REGISTER): Update.
	(AVGPR_REGNO_P): Define.
	(enum reg_class): Add AVGPR_REGS and ALL_VGPR_REGS.
	(REG_CLASS_CONTENTS): Add new register classes and add entries for
	AVGPRs to all classes.
	(REGISTER_NAMES): Add AVGPRs.
	* config/gcn/gcn.md (FIRST_AVGPR_REG, LAST_AVGPR_REG): Define.
	(AP_REGNUM, FP_REGNUM): Update.
	(define_attr "type"): Add vop3p_mai.
	(define_attr "unit"): Handle vop3p_mai.
	(define_attr "gcn_version"): Add "cdna2".
	(define_attr "enabled"): Handle cdna2.
	(*mov<mode>_insn): Add AVGPR alternatives.
	(*movti_insn): Likewise.
	* config/gcn/mkoffload.cc (isa_has_combined_avgprs): New.
	(process_asm): Process avgpr_count.
	* config/gcn/predicates.md (gcn_avgpr_register_operand): New.
	(gcn_avgpr_hard_register_operand): New.
	* doc/md.texi: Document the "a" constraint.

2023-11-28  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-valu.md (mov<mode>_sgprbase): Add @ modifier.
	(reload_in<mode>): Delete.
	(reload_out<mode>): Delete.
	* config/gcn/gcn.cc (CODE_FOR): Delete.
	(get_code_for_##PREFIX##vN##SUFFIX): Delete.
	(CODE_FOR_OP): Delete.
	(get_code_for_##PREFIX): Delete.
	(gcn_secondary_reload): Replace "get_code_for" with "code_for".

2023-11-10  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.cc (gcn_expand_reduc_scalar): Add clobber to DImode
	min/max instructions.

2023-11-10  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-valu.md
	(vec_extract<V_1REG:mode><V_1REG_ALT:mode>_nop): Mention "operands" in
	condition to silence the warnings.
	(vec_extract<V_2REG:mode><V_2REG_ALT:mode>_nop): Likewise.
	* config/gcn/gcn.md (*movti_insn): Likewise.

2023-11-10  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-valu.md (*mov<mode>): Convert to compact syntax.
	(mov<mode>_exec): Likewise.
	(mov<mode>_sgprbase): Likewise.
	* config/gcn/gcn.md (*mov<mode>_insn): Likewise.
	(*movti_insn): Likewise.

2023-11-10  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.cc (print_operand): Adjust xcode type to fix warning.

2023-11-10  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	Tamar Christina <tamar.christina@arm.com>

	* gensupport.cc (class conlist, add_constraints, add_attributes,
	skip_spaces, expect_char, preprocess_compact_syntax,
	parse_section_layout, parse_section, convert_syntax): New.
	(process_rtx): Check for conversion.
	* genoutput.cc (process_template): Check for unresolved iterators.
	(class data): Add compact_syntax_p.
	(gen_insn): Use it.
	* gensupport.h (compact_syntax): New.
	(hash-set.h): Include.
	* doc/md.texi: Document it.

2023-10-30  Tobias Burnus  <tobias@codesourcery.com>

	* gcc/gimplify.cc (gimplify_omp_allocate): Gimplify allocator.
	* omp-low.cc (lower_omp_allocate): Simplify; GOMP_free can also
	take a plain 0 as allocator argument (arg is unused in libgomp).

2023-10-27  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2023-10-18  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (gimplify_bind_expr): Remove "omp allocate" attribute
	to avoid that auxillary statement list reaches LTO.

2023-10-26  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2023-10-14  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (gimplify_bind_expr): Handle Fortran's
	'omp allocate' for stack variables.

2023-10-26  Tobias Burnus  <tobias@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	* omp-low.cc (scan_sharing_clauses): Update message for directive use.
	(lower_omp_allocate, lower_omp_1): Update for clause changes; handle
	alignment.
	* tree-core.h (enum omp_clause_code): Remove OMP_CLAUSE_ALLOCATOR.
	* tree-pretty-print.cc (dump_omp_clause): Likewise.
	* tree.cc (omp_clause_num_ops): Likewise.
	* tree.h (OMP_ALLOCATE_DECL, OMP_ALLOCATE_ALLOCATOR): Remove.

2023-09-20  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2023-09-20  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (gimplify_bind_expr): Call GOMP_alloc/free for
	'omp allocate' variables; move stack cleanup after other
	cleanup.
	(omp_notice_variable): Process original decl when decl
	of the value-expression for a 'omp allocate' variable is passed.
	* omp-low.cc (scan_omp_1_op): Handle 'omp allocate' variables

2023-09-19  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2023-08-22  Tobias Burnus  <tobias@codesourcery.com>

	* tree-core.h (enum omp_clause_defaultmap_kind): Add
	OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALL.
	* gimplify.cc (gimplify_scan_omp_clauses): Handle it.
	* tree-pretty-print.cc (dump_omp_clause): Likewise.

2023-09-12  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2023-09-12  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (gimplify_bind_expr): Check for
	insertion after variable cleanup.  Convert 'omp allocate'
	var-decl attribute to GOMP_alloc/GOMP_free calls.

2023-07-14  Julian Brown  <julian@codesourcery.com>

	* omp-low.cc (lower_omp_target): Reverse iteration over array
	dimensions.

2023-07-12  Julian Brown  <julian@codesourcery.com>

	* omp-low.cc (lower_omp_target): Calculate volume enclosing
	transferred elements instead of using whole array size for
	noncontiguous 'target update' operations.

2023-07-03  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses): Don't gimplify
	VIEW_CONVERT_EXPR away in GOMP_MAP_TO_GRID/GOMP_MAP_FROM_GRID clauses.
	* omp-low.cc (omp_noncontig_descriptor_type): Add SPAN field.
	(scan_sharing_clauses): Don't store descriptor size in its
	OMP_CLAUSE_SIZE field.
	(lower_omp_target): Add missing OMP_CLAUSE_MAP check.  Add special-case
	string handling.  Handle span and bias.  Use low bound instead of zero
	as index for trailing full dimensions.

2023-07-03  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_group_last, omp_group_base): Add GOMP_MAP_TO_GRID,
	GOMP_MAP_FROM_GRID support.
	(gimplify_adjust_omp_clauses): Support new GOMP_MAP_GRID_DIM,
	GOMP_MAP_GRID_STRIDE mapping nodes.  Don't crash on e.g. misuse of
	ADDR_EXPR in mapping clauses.
	* omp-general.cc (omp_parse_noncontiguous_array): New function.
	(omp_parse_access_method): Add noncontiguous array support.
	(omp_parse_structure_base): Add array-shaping support.
	(debug_omp_tokenized_addr): Add ACCESS_NONCONTIG_ARRAY,
	ACCESS_NONCONTIG_REF_TO_ARRAY token support.
	* omp-general.h (access_method_kinds): Add ACCESS_NONCONTIG_ARRAY and
	ACCESS_NONCONTIG_REF_TO_ARRAY access kinds.
	* omp-low.cc (omp_noncontig_descriptor_type): New function.
	(scan_sharing_clauses): Support noncontiguous array updates.
	(lower_omp_target): Likewise.
	* tree-pretty-print.cc (dump_omp_clause): Add GOMP_MAP_TO_GRID,
	GOMP_MAP_FROM_GRID, GOMP_MAP_GRID_DIM, GOMP_MAP_GRID_STRIDE map kinds.
	(dump_generic_node): Add stride support for OMP_ARRAY_SECTION.
	* tree.def (OMP_ARRAY_SECTION): Add stride argument.

2023-07-03  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_get_attachment): Handle GOMP_MAP_DETACH here.
	(omp_group_last): Handle *, GOMP_MAP_DETACH, GOMP_MAP_ATTACH_DETACH
	groups for "exit data" of reference-to-pointer component array
	sections.
	(omp_group_base): Handle GOMP_MAP_DETACH.

2023-06-30  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (dwarf2out.h): Include.
	(omp_maybe_get_descriptor_from_ptr): New function.
	(build_omp_struct_comp_nodes): Use above function to locate array
	descriptor when necessary.
	(omp_mapping_group_data, omp_mapping_group_ptr,
	omp_mapping_group_pset): New functions.
	(omp_instantiate_mapper): Handle inlining of "declare mapper" function
	bodies containing setup code (e.g. for Fortran).  Handle pointers to
	derived types.  Handle GOMP_MAP_MAPPING_GROUPs.
	* tree-pretty-print.cc (dump_omp_clause): Handle
	GOMP_MAP_MAPPING_GROUP.

2023-06-30  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_omp_ctx): Add IMPLICIT_MAPPERS field.
	(new_omp_context): Initialise IMPLICIT_MAPPERS hash map.
	(delete_omp_context): Delete IMPLICIT_MAPPERS hash map.
	(instantiate_mapper_info): New structs.
	(remap_mapper_decl_1, omp_mapper_copy_decl, omp_instantiate_mapper,
	omp_instantiate_implicit_mappers): New functions.
	(gimplify_scan_omp_clauses): Handle MAPPER_BINDING clauses.
	(gimplify_adjust_omp_clauses): Instantiate implicit declared mappers.
	(gimplify_omp_declare_mapper): New function.
	(gimplify_expr): Call above function.
	* langhooks-def.h (lhd_omp_finish_mapper_clauses,
	lhd_omp_mapper_lookup, lhd_omp_extract_mapper_directive,
	lhd_omp_map_array_section): Add prototypes.
	(LANG_HOOKS_OMP_FINISH_MAPPER_CLAUSES,
	LANG_HOOKS_OMP_MAPPER_LOOKUP, LANG_HOOKS_OMP_EXTRACT_MAPPER_DIRECTIVE,
	LANG_HOOKS_OMP_MAP_ARRAY_SECTION): Define macros.
	(LANG_HOOK_DECLS): Add above macros.
	* langhooks.cc (lhd_omp_finish_mapper_clauses,
	lhd_omp_mapper_lookup, lhd_omp_extract_mapper_directive,
	lhd_omp_map_array_section): New dummy functions.
	* langhooks.h (lang_hooks_for_decls): Add OMP_FINISH_MAPPER_CLAUSES,
	OMP_MAPPER_LOOKUP, OMP_EXTRACT_MAPPER_DIRECTIVE, OMP_MAP_ARRAY_SECTION
	hooks.
	* omp-general.h (omp_name_type<T>): Add templatized struct, hash type
	traits (for omp_name_type<tree> specialization).
	(omp_mapper_list<T>): Add struct.
	* tree-core.h (omp_clause_code): Add OMP_CLAUSE__MAPPER_BINDING_.
	* tree-pretty-print.cc (dump_omp_clause): Support GOMP_MAP_UNSET,
	GOMP_MAP_PUSH_MAPPER_NAME, GOMP_MAP_POP_MAPPER_NAME artificial mapping
	clauses.  Support OMP_CLAUSE__MAPPER_BINDING_ and OMP_DECLARE_MAPPER.
	* tree.cc (omp_clause_num_ops, omp_clause_code_name): Add
	OMP_CLAUSE__MAPPER_BINDING_.
	* tree.def (OMP_DECLARE_MAPPER): New tree code.
	* tree.h (OMP_DECLARE_MAPPER_ID, OMP_DECLARE_MAPPER_DECL,
	OMP_DECLARE_MAPPER_CLAUSES): New defines.
	(OMP_CLAUSE__MAPPER_BINDING__ID, OMP_CLAUSE__MAPPER_BINDING__DECL,
	OMP_CLAUSE__MAPPER_BINDING__MAPPER): New defines.

2023-06-30  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_expr): Ensure OMP_ARRAY_SECTION has been
	processed out before gimplification.
	* tree-pretty-print.cc (dump_generic_node): Support OMP_ARRAY_SECTION.
	* tree.def (OMP_ARRAY_SECTION): New tree code.

2023-06-30  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_scan_omp_clauses): Add note about
	DECL_VALUE_EXPR handling for struct mapping nodes.
	(gimplify_adjust_omp_clauses): Perform DECL_VALUE_EXPR substitution
	before DECL_P check.

2023-06-20  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	2023-06-19  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.cc (gcn_expand_divmod_libfunc): New function.
	(gcn_init_libfuncs): Add div and mod functions for all modes.
	Add placeholders for divmod functions.
	(TARGET_EXPAND_DIVMOD_LIBFUNC): Define.

2023-06-20  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	2023-06-19  Andrew Stubbs  <ams@codesourcery.com>

	* tree-vect-generic.cc: Include optabs-libfuncs.h.
	(get_compute_type): Check optab_libfunc.
	* tree-vect-stmts.cc: Include optabs-libfuncs.h.
	(vectorizable_operation): Check optab_libfunc.

2023-06-20  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	2023-06-19  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-protos.h (vgpr_4reg_mode_p): New function.
	* config/gcn/gcn-valu.md (V_4REG, V_4REG_ALT): New iterators.
	(V_MOV, V_MOV_ALT): Likewise.
	(scalar_mode, SCALAR_MODE): Add TImode.
	(vnsi, VnSI, vndi, VnDI): Likewise.
	(vec_merge, vec_merge_with_clobber, vec_merge_with_vcc): Use V_MOV.
	(mov<mode>, mov<mode>_unspec): Use V_MOV.
	(*mov<mode>_4reg): New insn.
	(mov<mode>_exec): New 4reg variant.
	(mov<mode>_sgprbase): Likewise.
	(reload_in<mode>, reload_out<mode>): Use V_MOV.
	(vec_set<mode>): Likewise.
	(vec_duplicate<mode><exec>): New 4reg variant.
	(vec_extract<mode><scalar_mode>): Likewise.
	(vec_extract<V_ALL:mode><V_ALL_ALT:mode>): Rename to ...
	(vec_extract<V_MOV:mode><V_MOV_ALT:mode>): ... this, and use V_MOV.
	(vec_extract<V_4REG:mode><V_4REG_ALT:mode>_nop): New 4reg variant.
	(fold_extract_last_<mode>): Use V_MOV.
	(vec_init<V_ALL:mode><V_ALL_ALT:mode>): Rename to ...
	(vec_init<V_MOV:mode><V_MOV_ALT:mode>): ... this, and use V_MOV.
	(gather_load<mode><vnsi>, gather<mode>_expr<exec>,
	gather<mode>_insn_1offset<exec>, gather<mode>_insn_1offset_ds<exec>,
	gather<mode>_insn_2offsets<exec>): Use V_MOV.
	(scatter_store<mode><vnsi>, scatter<mode>_expr<exec_scatter>,
	scatter<mode>_insn_1offset<exec_scatter>,
	scatter<mode>_insn_1offset_ds<exec_scatter>,
	scatter<mode>_insn_2offsets<exec_scatter>): Likewise.
	(maskload<mode>di, maskstore<mode>di, mask_gather_load<mode><vnsi>,
	mask_scatter_store<mode><vnsi>): Likewise.
	* config/gcn/gcn.cc (gcn_class_max_nregs): Use vgpr_4reg_mode_p.
	(gcn_hard_regno_mode_ok): Likewise.
	(GEN_VNM): Add TImode support.
	(USE_TI): New macro. Separate TImode operations from non-TImode ones.
	(gcn_vector_mode_supported_p): Add V64TImode, V32TImode, V16TImode,
	V8TImode, and V2TImode.
	(print_operand):  Add 'J' and 'K' print codes.


2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Set
	OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P for OpenACC also.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Handle "oacc declare
	create" attribute.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_tsort_mark, omp_mapping_group): Move before
	gimplify_omp_ctx. Add constructor to omp_mapping_group.
	(gimplify_omp_ctx): Add DECL_DATA_CLAUSE field.
	(new_omp_context, delete_omp_context): Initialise and free above field.
	(omp_gather_mapping_groups_1): Use constructor for omp_mapping_group.
	(gimplify_scan_omp_clauses): Record mappings that might be lexically
	inherited.  Don't remove
	GOMP_MAP_FIRSTPRIVATE_POINTER/GOMP_MAP_FIRSTPRIVATE_REFERENCE yet.
	(gomp_oacc_needs_data_present): New function.
	(gimplify_adjust_omp_clauses_1): Implement lexical inheritance
	behaviour for OpenACC.
	(gimplify_adjust_omp_clauses): Remove
	GOMP_MAP_FIRSTPRIVATE_POINTER/GOMP_MAP_FIRSTPRIVATE_REFERENCE here
	instead, after lexical inheritance is done.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_segregate_mapping_groups): Handle "present" groups.
	(gimplify_scan_omp_clauses): Use mapping group functionality to
	iterate through mapping nodes.  Remove most gimplification of
	OMP_CLAUSE_MAP nodes from here, but still populate ctx->variables
	splay tree.
	(gimplify_adjust_omp_clauses): Move most gimplification of
	OMP_CLAUSE_MAP nodes here.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (extract_base_bit_offset): Add VARIABLE_OFFSET parameter.
	(omp_get_attachment, omp_group_last, omp_group_base,
	omp_directive_maps_explicitly): Add GOMP_MAP_STRUCT_UNORD support.
	(omp_accumulate_sibling_list): Update calls to extract_base_bit_offset.
	Support GOMP_MAP_STRUCT_UNORD.
	(omp_build_struct_sibling_lists, gimplify_scan_omp_clauses,
	gimplify_adjust_omp_clauses, gimplify_omp_target_update): Add
	GOMP_MAP_STRUCT_UNORD support.
	* omp-low.cc (lower_omp_target): Add GOMP_MAP_STRUCT_UNORD support.
	* tree-pretty-print.cc (dump_omp_clause): Likewise.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_map_clause_descriptor_p): New function.
	(build_omp_struct_comp_nodes, omp_get_attachment, omp_group_base): Use
	above function.
	(omp_tsort_mapping_groups): Process nodes that have
	OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P set after those that don't.  Add
	enter_exit_data parameter.
	(omp_resolve_clause_dependencies): Remove GOMP_MAP_TO_PSET mappings if
	we're mapping the whole containing derived-type variable.
	(omp_accumulate_sibling_list): Adjust GOMP_MAP_TO_PSET handling.
	Remove GOMP_MAP_ALWAYS_POINTER handling.
	(gimplify_scan_omp_clauses): Pass enter_exit argument to
	omp_tsort_mapping_groups.  Don't adjust/remove GOMP_MAP_TO_PSET
	mappings for derived-type components here.
	* tree.h (OMP_CLAUSE_RELEASE_DESCRIPTOR): New macro.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_accumulate_sibling_list): Don't require
	explicitly-mapped base pointer for compute regions.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (build_struct_comp_nodes): Don't process
	GOMP_MAP_ATTACH_DETACH "middle" nodes here.
	(omp_mapping_group): Add REPROCESS_STRUCT and FRAGILE booleans for
	nested struct handling.
	(omp_strip_components_and_deref, omp_strip_indirections): Remove
	functions.
	(omp_gather_mapping_groups_1): Initialise reprocess_struct and fragile
	fields.
	(omp_group_base): Handle GOMP_MAP_ATTACH_DETACH after GOMP_MAP_STRUCT.
	(omp_index_mapping_groups_1): Skip reprocess_struct groups.
	(omp_get_nonfirstprivate_group, omp_directive_maps_explicitly,
	omp_resolve_clause_dependencies, omp_expand_access_chain,
	omp_first_chained_access_token): New functions.
	(omp_check_mapping_compatibility): Adjust accepted node combinations
	for changes elsewhere.
	(omp_accumulate_sibling_list): Add GROUP_MAP, ADDR_TOKENS, FRAGILE_P,
	REPROCESSING_STRUCT, ADDED_TAIL parameters.  Use OMP address tokenizer
	to analyze addresses.  Reimplement nested struct handling, and
	implement "fragile groups".
	(omp_build_struct_sibling_lists): Adjust for changes to
	omp_accumulate_sibling_list.  Recalculate bias for ATTACH_DETACH nodes
	after GOMP_MAP_STRUCT nodes.
	(gimplify_scan_omp_clauses): Call omp_resolve_clause_dependencies.  Use
	OMP address tokenizer.
	(gimplify_adjust_omp_clauses_1): Use build_fold_indirect_ref_loc
	instead of build_simple_mem_ref_loc.
	* omp-general.cc (omp-general.h): Include.
	(omp_addr_tokenizer): New namespace.
	(omp_addr_tokenizer::omp_addr_token): New.
	(omp_addr_tokenizer::omp_parse_component_selector,
	omp_addr_tokenizer::omp_parse_ref,
	omp_addr_tokenizer::omp_parse_pointer,
	omp_addr_tokenizer::omp_parse_access_method,
	omp_addr_tokenizer::omp_parse_access_methods,
	omp_addr_tokenizer::omp_parse_structure_base,
	omp_addr_tokenizer::omp_parse_structured_expr,
	omp_addr_tokenizer::omp_parse_array_expr,
	omp_addr_tokenizer::omp_access_chain_p,
	omp_addr_tokenizer::omp_accessed_addr): New functions.
	(omp_parse_expr, debug_omp_tokenized_addr): New functions.
	* omp-general.h (omp_addr_tokenizer::access_method_kinds,
	omp_addr_tokenizer::structure_base_kinds,
	omp_addr_tokenizer::token_type,
	omp_addr_tokenizer::omp_addr_token,
	omp_addr_tokenizer::omp_access_chain_p,
	omp_addr_tokenizer::omp_accessed_addr): New.
	(omp_addr_token, omp_parse_expr): New.
	* omp-low.cc (scan_sharing_clauses): Skip error check for references
	to pointers.
	* tree.h (OMP_CLAUSE_ATTACHMENT_MAPPING_ERASED): New macro.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	Revert:
	2018-08-28  Julian Brown  <julian@codesourcery.com>
		    Cesar Philippidis  <cesar@codesourcery.com>

	* gimplify.cc (oacc_array_mapping_info): New struct.
	(gimplify_omp_ctx): Add decl_data_clause hash map.
	(new_omp_context): Zero-initialise above.
	(delete_omp_context): Delete above if allocated.
	(gimplify_scan_omp_clauses): Scan for array mappings on data constructs,
	and record in above map.
	(gomp_oacc_needs_data_present): New function.
	(gimplify_adjust_omp_clauses_1): Handle data mappings (e.g. array
	slices) declared in lexically-enclosing data constructs.
	* omp-low.cc (lower_omp_target): Allow decl for bias not to be present
	in OpenACC context.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	Revert:
	2019-05-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (oacc_array_mapping_info): Add REF field.
	(gimplify_scan_omp_clauses): Initialise above field for data blocks
	passed by reference.
	(gomp_oacc_needs_data_present): Handle references.
	(gimplify_adjust_omp_clauses_1): Handle references and optional
	arguments for variables declared in lexically-enclosing OpenACC data
	region.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	Revert:
	2019-07-10  Cesar Philippidis  <cesar@codesourcery.com>
		    Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Raise error for
	assumed-size arrays in map clauses for Fortran/OpenMP.
	* omp-low.cc (lower_omp_target): Set the size of assumed-size Fortran
	arrays to one to allow use of data already mapped on the offload device.

2023-06-13  Sandra Loosemore  <sandra@codesourcery.com>

	* omp-api.h: New.
	* omp-general.cc (omp_runtime_api_procname): New.
	(omp_runtime_api_call): Moved here from omp-low.cc, and make
	non-static.
	* omp-general.h: Include omp-api.h.
	* omp-low.cc (omp_runtime_api_call): Delete this copy.

2023-06-13  Sandra Loosemore  <sandra@codesourcery.com>
	    Frederik Harwath <frederik@codesourcery.com>

	* tree-nested.cc (convert_nonlocal_omp_clauses): Handle loop
	transformation clauses.
	(convert_local_omp_clauses): Likewise.

2023-06-12  Tobias Burnus  <tobias@codesourcery.com>

	Backported from mainline:
	2023-06-12  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Use
	GOMP_MAP_FORCE_PRESENT for 'present alloc' implicit mapping.
	(gimplify_adjust_omp_clauses): Change
	GOMP_MAP_PRESENT_{TO,TOFROM,FROM,ALLOC} to the equivalent
	GOMP_MAP_FORCE_PRESENT.
	* omp-low.cc (lower_omp_target): Remove handling of no-longer valid
	GOMP_MAP_PRESENT_{TO,TOFROM,FROM,ALLOC}; update map kinds used for
	to/from clauses with present modifier.

2023-06-07  Tobias Burnus  <tobias@codesourcery.com>

	Backported from mainline:
	2023-06-06  Kwok Cheung Yeung  <kcy@codesourcery.com>
		    Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (omp_notice_variable): Apply GOVD_MAP_ALLOC_ONLY flag
	and defaultmap flags if the defaultmap has GOVD_MAP_FORCE_PRESENT flag
	set.
	(omp_get_attachment): Handle map clauses with 'present' modifier.
	(omp_group_base): Likewise.
	(gimplify_scan_omp_clauses): Reorder present maps to come first.
	Set GOVD flags for present defaultmaps.
	(gimplify_adjust_omp_clauses_1): Set map kind for present defaultmaps.
	* omp-low.cc (scan_sharing_clauses): Handle 'always, present' map
	clauses.
	(lower_omp_target): Handle map clauses with 'present' modifier.
	Handle 'to' and 'from' clauses with 'present'.
	* tree-core.h (enum omp_clause_defaultmap_kind): Add
	OMP_CLAUSE_DEFAULTMAP_PRESENT defaultmap kind.
	* tree-pretty-print.cc (dump_omp_clause): Handle 'map', 'to' and
	'from' clauses with 'present' modifier.  Handle present defaultmap.
	* tree.h (OMP_CLAUSE_MOTION_PRESENT): New #define.

2023-06-07  Tobias Burnus  <tobias@codesourcery.com>

	Reverted:
	2023-02-01  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (omp_notice_variable): Apply GOVD_MAP_ALLOC_ONLY flag
	and defaultmap flags if the defaultmap has GOVD_MAP_FORCE_PRESENT flag
	set.
	(omp_get_attachment): Handle map clauses with 'present' modifier.
	(omp_group_base): Likewise.
	(gimplify_scan_omp_clauses): Reorder present maps to come first.
	Set GOVD flags for present defaultmaps.
	(gimplify_adjust_omp_clauses_1): Set map kind for present defaultmaps.
	* omp-low.cc (scan_sharing_clauses): Handle 'always, present' map
	clauses.
	(lower_omp_target): Handle map clauses with 'present' modifier.
	Handle 'to' and 'from' clauses with 'present'.
	* tree-core.h (enum omp_clause_defaultmap_kind): Add
	OMP_CLAUSE_DEFAULTMAP_PRESENT defaultmap kind.
	(enum omp_clause_motion_modifier): New.
	(struct tree_omp_clause): Add motion_modifier field.
	* tree-pretty-print.cc (dump_omp_clause): Handle 'map', 'to' and
	'from' clauses with 'present' modifier.  Handle present defaultmap.
	* tree.h (OMP_CLAUSE_MOTION_MODIFIER): New.
	(OMP_CLAUSE_SET_MOTION_MODIFIER): New.

2023-05-30  Tobias Burnus  <tobias@codesourcery.com>

	* config/gcn/gcn.opt (mxnack=): Fix default value in the
	description line.
	* doc/invoke.texi (mxnack): Update to the on/off/any
	version.

2023-05-30  Tobias Burnus  <tobias@codesourcery.com>

	Backport from master:
	2023-05-21  Roger Sayle  <roger@nextmovesoftware.com>

	* config/nvptx/nvptx.cc (nvptx_expand_brev): Expand target
	builtin for bit reversal using brev instruction.
	(enum nvptx_builtins): Add NVPTX_BUILTIN_BREV and
	NVPTX_BUILTIN_BREVLL.
	(nvptx_init_builtins): Define "brev" and "brevll".
	(nvptx_expand_builtin): Expand NVPTX_BUILTIN_BREV and
	NVPTX_BUILTIN_BREVLL via nvptx_expand_brev function.
	* doc/extend.texi (Nvidia PTX Builtin-in Functions): New
	section, document __builtin_nvptx_brev{,ll}.

2023-05-30  Tobias Burnus  <tobias@codesourcery.com>

	Backport from master:
	2023-05-05  Tobias Burnus  <tobias@codesourcery.com>

	* config/gcn/gcn.cc (gcn_vectorize_builtin_vectorized_function): Remove
	unused in_mode/in_n variables.

2023-05-12  Julian Brown  <julian@codesourcery.com>

	* omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): New builtin.
	* tree.cc (get_file_function_name): Support names for on-target
	constructor/destructor functions.

2023-05-04  Frederik Harwath  <frederik@codesourcery.com>

	* omp-transform-loops.cc (full_unroll): Add initialization of index variable.

2023-04-18  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (omp_group_base): Handle GOMP_MAP_NONCONTIG_ARRAY_*
	map types.

2023-04-17  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (omp_group_base): Handle GOMP_MAP_DECLARE_ALLOCATE
	and GOMP_MAP_DECLARE_DEALLOCATE.

2023-04-03  Thomas Schwinge  <thomas@codesourcery.com>

	* doc/invoke.texi (-foffload-memory=pinned): Document.

2023-03-31  Frederik Harwath  <frederik@codesourcery.com>

	* omp-transform-loops.cc (walk_omp_for_loops): Handle
	GIMPLE_OMP_METADIRECTIVE.

2023-03-24  Frederik Harwath  <frederik@codesourcery.com>

	* omp-transform-loops.cc (gimple_assign_rhs_to_tree): Fix type
	in comment.
	(gomp_for_uncollapse): Adjust "collapse" value after uncollapse.
	(partial_unroll): Add argument for the loop nest level to be transformed.
	(tile): Likewise.
	(transform_gomp_for): Pass level to transformatoin functions.
	(optimize_transformation_clauses): Handle transformation clauses for all
	levels recursively.
	* tree-pretty-print.cc (dump_omp_clause): Print
	OMP_CLAUSE_TRANSFORM_LEVEL for OMP_CLAUSE_UNROLL_FULL,
	OMP_CLAUSE_UNROLL_PARTIAL, and OMP_CLAUSE_TILE.
	* tree.cc: Increase number of operands of OMP_CLAUSE_UNROLL_FULL,
	OMP_CLAUSE_UNROLL_PARTIAL, and OMP_CLAUSE_TILE.
	* tree.h (OMP_CLAUSE_TRANSFORM_LEVEL): New macro to access
	clause operand 0.
	(OMP_CLAUSE_UNROLL_PARTIAL_EXPR): Use operand 1 instead of 0.
	(OMP_CLAUSE_TILE_SIZES): Likewise.

2023-03-24  Frederik Harwath  <frederik@codesourcery.com>

	* gimplify.cc (omp_for_drop_tile_clauses): New function, ...
	(gimplify_omp_for): ... used here.

2023-03-24  Frederik Harwath  <frederik@codesourcery.com>

	* gimplify.cc (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_TILE.
	(gimplify_adjust_omp_clauses): Likewise.
	(gimplify_omp_loop): Likewise.
	* omp-transform-loops.cc (walk_omp_for_loops): New declaration.
	(subst_var_in_op): New function.
	(subst_var): New function.
	(gomp_for_number_of_iterations): Adjust.
	(gomp_for_iter_count_type): New function.
	(gimple_assign_rhs_to_tree): New function.
	(subst_defs): New function.
	(gomp_for_uncollapse): Adjust.
	(transformation_clause_p): Add OMP_CLAUSE_TILE.
	(tile): New function.
	(transform_gomp_for): Handle OMP_CLAUSE_TILE.
	(optimize_transformation_clauses): Handle OMP_CLAUSE_TILE.
	* omp-general.cc (omp_loop_transform_clause_p): Add
	OMP_CLAUSE_TILE.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_TILE.
	* tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_TILE.
	* tree.cc: Add OMP_CLAUSE_TILE.
	* tree.h (OMP_CLAUSE_TILE_SIZES): New macro.

2023-03-24  Frederik Harwath  <frederik@codesourcery.com>

	* tree-core.h (enum omp_clause_code): Rename OMP_CLAUSE_TILE.
	* tree.h (OMP_CLAUSE_TILE_LIST): Rename to ...
	(OMP_CLAUSE_OACC_TILE_LIST): ... this.
	(OMP_CLAUSE_TILE_ITERVAR): Rename to ...
	(OMP_CLAUSE_OACC_TILE_ITERVAR): ... this.
	(OMP_CLAUSE_TILE_COUNT): Rename to ...
	(OMP_CLAUSE_OACC_TILE_COUNT): this.
	* gimplify.cc (gimplify_scan_omp_clauses): Adjust to renamings.
	(gimplify_adjust_omp_clauses): Likewise.
	(gimplify_omp_for): Likewise.
	* omp-general.cc (omp_extract_for_data): Likewise.
	* omp-low.cc (scan_sharing_clauses): Likewise.
	(lower_oacc_head_mark): Likewise.
	* tree-nested.cc (convert_nonlocal_omp_clauses): Likewise.
	(convert_local_omp_clauses): Likewise.
	* tree-pretty-print.cc (dump_omp_clause): Likewise.
	* tree.cc: Likewise.

2023-03-24  Frederik Harwath  <frederik@codesourcery.com>

	* Makefile.in: Add omp_transform_loops.o.
	* gimple-pretty-print.cc (dump_gimple_omp_for): Handle "full"
	and "partial" clauses.
	* gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_TRANSFORM_LOOP.
	* gimplify.cc (is_gimple_stmt): Handle OMP_UNROLL.
	(gimplify_scan_omp_clauses): Handle OMP_UNROLL_FULL,
	OMP_UNROLL_NONE, and OMP_UNROLL_PARTIAL.
	(gimplify_adjust_omp_clauses): Handle OMP_UNROLL_FULL,
	OMP_UNROLL_NONE, and OMP_UNROLL_PARTIAL.
	(gimplify_omp_for): Handle OMP_UNROLL.
	(gimplify_expr): Likewise.
	* params.opt: Add omp-unroll-full-max-iteration and
	omp-unroll-default-factor.
	* passes.def: Add pass_omp_transform_loop before
	pass_lower_omp.
	* tree-core.h (enum omp_clause_code): Add
	OMP_CLAUSE_UNROLL_NONE, OMP_CLAUSE_UNROLL_FULL, and
	OMP_CLAUSE_UNROLL_PARTIAL.
	* tree-pass.h (make_pass_omp_transform_loops): Declare
	pmake_pass_omp_transform_loops.
	* tree-pretty-print.cc (dump_omp_clause): Handle
	OMP_CLAUSE_UNROLL_NONE, OMP_CLAUSE_UNROLL_FULL, and
	OMP_CLAUSE_UNROLL_PARTIAL.
	(dump_generic_node): Handle OMP_UNROLL.
	* tree.cc (omp_clause_num_ops): Add number of operators
	for OMP_CLAUSE_UNROLL_FULL, OMP_CLAUSE_UNROLL_NONE, and
	OMP_CLAUSE_UNROLL_PARTIAL.
	(omp_clause_code_names): Add name strings for
	OMP_CLAUSE_UNROLL_FULL, OMP_CLAUSE_UNROLL_NONE, and
	OMP_CLAUSE_UNROLL_PARTIAL.
	* tree.def (OMP_UNROLL): Define.
	* tree.h (OMP_CLAUSE_UNROLL_PARTIAL_EXPR): Define.
	* omp-transform-loops.cc: New file.
	* omp-general.cc (omp_loop_transform_clause_p): New function.
	* omp-general.h (omp_loop_transform_clause_p): New declaration.

2023-03-17  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.cc (gcn_class_max_nregs): Handle vectors in SGPRs.
	(move_callee_saved_registers): Detect the bug condition early.

2023-03-17  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-valu.md (gather_load<mode><vndi>): New.
	(scatter_store<mode><vndi>): New.
	(mask_gather_load<mode><vndi>): New.
	(mask_scatter_store<mode><vndi>): New.

2023-03-17  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-protos.h (gcn_stepped_zero_int_parallel_p): New.
	* config/gcn/gcn-valu.md (V_1REG_ALT): New.
	(V_2REG_ALT): New.
	(vec_extract<V_1REG:mode><V_1REG_ALT:mode>_nop): New.
	(vec_extract<V_2REG:mode><V_2REG_ALT:mode>_nop): New.
	(vec_extract<V_ALL:mode><V_ALL_ALT:mode>): Use new patterns.
	* config/gcn/gcn.cc (gcn_stepped_zero_int_parallel_p): New.
	* config/gcn/predicates.md (ascending_zero_int_parallel): New.

2023-02-22  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (gimplify_scan_omp_clauses): Remove Fortran
	special case.

2023-02-16  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-builtins.def (DISPATCH_PTR): New built-in.
	* config/gcn/gcn.cc (gcn_init_machine_status): Disable global
	addressing.
	(gcn_expand_builtin_1): Implement GCN_BUILTIN_DISPATCH_PTR.

2023-02-01  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (omp_notice_variable): Apply GOVD_MAP_ALLOC_ONLY flag
	and defaultmap flags if the defaultmap has GOVD_MAP_FORCE_PRESENT flag
	set.
	(omp_get_attachment): Handle map clauses with 'present' modifier.
	(omp_group_base): Likewise.
	(gimplify_scan_omp_clauses): Reorder present maps to come first.
	Set GOVD flags for present defaultmaps.
	(gimplify_adjust_omp_clauses_1): Set map kind for present defaultmaps.
	* omp-low.cc (scan_sharing_clauses): Handle 'always, present' map
	clauses.
	(lower_omp_target): Handle map clauses with 'present' modifier.
	Handle 'to' and 'from' clauses with 'present'.
	* tree-core.h (enum omp_clause_defaultmap_kind): Add
	OMP_CLAUSE_DEFAULTMAP_PRESENT defaultmap kind.
	(enum omp_clause_motion_modifier): New.
	(struct tree_omp_clause): Add motion_modifier field.
	* tree-pretty-print.cc (dump_omp_clause): Handle 'map', 'to' and
	'from' clauses with 'present' modifier.  Handle present defaultmap.
	* tree.h (OMP_CLAUSE_MOTION_MODIFIER): New.
	(OMP_CLAUSE_SET_MOTION_MODIFIER): New.

2023-01-20  Thomas Schwinge  <thomas@codesourcery.com>

	* collect2.cc (write_c_file_glob): Allow for
	'COLLECT2_MAIN_REFERENCE' override.
	* config.gcc <case ${target} in nvptx-*>: Set 'use_collect2=yes'.
	* config/nvptx/nvptx.h: Adjust.

	* config/nvptx/nvptx.cc (nvptx_assemble_undefined_decl): Notice
	'__nvptx_stacks', '__nvptx_uni' declarations.
	(nvptx_file_end): Don't emit duplicate declarations for those.

	* config/nvptx/nvptx.md (nvptx_uniform_warp_check): Make fit for
	non-full-warp execution.

2022-11-01  Marcel Vollweiler  <marcel@codesourcery.com>

	* omp-expand-metadirective.cc (omp_expand_metadirective): Add already
	processed labels to "labels" (the list of labels not to be deleted).

2022-10-25  Abid Qadeer  <abidh@codesourcery.com>

	* omp-low.cc (usm_transform): Handle operator new with alignment.

2022-10-24  Andrew Stubbs  <ams@codesourcery.com>

	* tree-vect-data-refs.cc (vect_analyze_data_refs): Workaround an
	address-space bug.

2022-10-24  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.cc (gcn_init_cumulative_args): Disallow gfx908.

2022-10-24  Andrew Stubbs  <ams@codesourcery.com>

	* plugin/plugin-gcn.c (HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED): New.
	(HSA_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT): New.
	(HSA_AMD_SVM_ATTRIB_GLOBAL_FLAG): New.
	(HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED): New.
	(hsa_amd_svm_attribute_pair_t): New.
	(struct hsa_runtime_fn_info): Add hsa_amd_svm_attributes_set_fn.
	(dump_hsa_system_info): Dump HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED and
	HSA_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT.
	(DLSYM_OPT_FN): New.
	(init_hsa_runtime_functions): Add hsa_amd_svm_attributes_set.
	(GOMP_OFFLOAD_usm_alloc): Use malloc and hsa_amd_svm_attributes_set.
	(GOMP_OFFLOAD_usm_free): Use regular free.
	* testsuite/libgomp.c/usm-1.c: Add -mxnack=on for amdgcn.
	* testsuite/libgomp.c/usm-2.c: Likewise.
	* testsuite/libgomp.c/usm-3.c: Likewise.
	* testsuite/libgomp.c/usm-4.c: Likewise.

2022-10-21  Tobias Burnus  <tobias@codesourcery.com>

	* omp-oacc-kernels-decompose.cc (top_level_omp_for_in_stmt,
	decompose_kernels_region_body): Handle GIMPLE_DEBUG like
	simple assignment.

2022-10-19  Tobias Burnus  <tobias@codesourcery.com>

	* omp-expand.cc (expand_omp_target): Fix OpenACC in case there
	are more than 3 arguments to the builtin function.

2022-07-12  Andrew Stubbs  <ams@codesourcery.com>

	* gimple-loop-versioning.cc (loop_versioning::loop_versioning): Add
	comment.
	* omp-general.cc (omp_max_simd_vf): New function.
	* omp-general.h (omp_max_simd_vf): New prototype.
	* omp-low.cc (lower_rec_simd_input_clauses): Select largest from
	  omp_max_vf, omp_max_simt_vf, and omp_max_simd_vf.

2022-06-17  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.c (unified_shared_memory_enabled): New variable.
	(gcn_init_cumulative_args): Handle attribute "omp unified memory".
	(gcn_hsa_declare_function_name): Emit "MKOFFLOAD OPTIONS: USM+".
	* config/gcn/mkoffload.c (TEST_XNACK_OFF): New macro.
	(process_asm): Detect "MKOFFLOAD OPTIONS: USM+".
	Emit configure_xnack constructor, as required.
	* omp-low.c (create_omp_child_function): Add attribute "omp unified
	memory".

2022-06-10  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-hsa.h (XNACKOPT): New macro.
	(ASM_SPEC): Use XNACKOPT.
	* config/gcn/gcn-opts.h (enum sram_ecc_type): Rename to ...
	(enum hsaco_attr_type): ... this, and generalize the names.
	(TARGET_XNACK): New macro.
	* config/gcn/gcn-valu.md (gather<mode>_insn_1offset<exec>):
	Add xnack compatible alternatives.
	(gather<mode>_insn_2offsets<exec>): Likewise.
	* config/gcn/gcn.c (gcn_option_override): Permit -mxnack for devices
	other than Fiji.
	(gcn_expand_epilogue): Remove early-clobber problems.
	(output_file_start): Emit xnack attributes.
	(gcn_hsa_declare_function_name): Obey -mxnack setting.
	* config/gcn/gcn.md (xnack): New attribute.
	(enabled): Rework to include "xnack" attribute.
	(*movbi): Add xnack compatible alternatives.
	(*mov<mode>_insn): Likewise.
	(*mov<mode>_insn): Likewise.
	(*mov<mode>_insn): Likewise.
	(*movti_insn): Likewise.
	* config/gcn/gcn.opt (-mxnack): Add the "on/off/any" syntax.
	(sram_ecc_type): Rename to ...
	(hsaco_attr_type: ... this.)
	* config/gcn/mkoffload.c (SET_XNACK_ANY): New macro.
	(TEST_XNACK): Delete.
	(TEST_XNACK_ANY): New macro.
	(TEST_XNACK_ON): New macro.
	(main): Support the new -mxnack=on/off/any syntax.

2022-06-17  Chung-Lin Tang  <cltang@codesourcery.com>

	Backport from mainline:
	2022-06-17  Chung-Lin Tang  <cltang@codesourcery.com>

	* builtin-types.def (BT_FN_VOID_PTRMODE): Define.
	(BT_FN_PTRMODE_PTRMODE_INT_PTR): Define.
	* omp-builtins.def (BUILT_IN_OMP_INIT_ALLOCATOR): Define.
	(BUILT_IN_OMP_DESTROY_ALLOCATOR): Define.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_USES_ALLOCATORS.
	* tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_USES_ALLOCATORS.
	* tree.h (OMP_CLAUSE_USES_ALLOCATORS_ALLOCATOR): New macro.
	(OMP_CLAUSE_USES_ALLOCATORS_MEMSPACE): New macro.
	(OMP_CLAUSE_USES_ALLOCATORS_TRAITS): New macro.
	* tree.cc (omp_clause_num_ops): Add OMP_CLAUSE_USES_ALLOCATORS.
	(omp_clause_code_name): Add "uses_allocators".
	(walk_tree_1): Add OMP_CLAUSE_USES_ALLOCATORS case.

	* gimplify.cc (gimplify_scan_omp_clauses): Add checking of OpenMP target
	region allocate clauses, to require a uses_allocators clause to exist
	for allocators.
	(gimplify_omp_workshare): Add handling of OMP_CLAUSE_USES_ALLOCATORS
	for OpenMP target regions; create calls of omp_init/destroy_allocator
	around target region body.
	* omp-low.cc (lower_private_allocate): Adjust receiving of allocator.
	(lower_rec_input_clauses): Likewise.
	(create_task_copyfn): Add dereference for allocator if needed.

	* system.h (startswith): New function.

2022-03-11  Andrew Stubbs  <ams@codesourcery.com>

	* omp-builtins.def (BUILT_IN_GOMP_ENABLE_PINNED_MODE): New.
	* omp-low.cc (omp_enable_pinned_mode): New function.
	(execute_lower_omp): Call omp_enable_pinned_mode.

2022-03-11  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* omp-low.cc (usm_transform): New function.
	(make_pass_usm_transform): Likewise.
	(class pass_usm_transform): New.
	* passes.def: Add pass_usm_transform.
	* tree-pass.h (make_pass_usm_transform): New declaration.

2022-02-02  Andrew Stubbs  <ams@codesourcery.com>

	* common.opt: Add -foffload-memory and its enum values.
	* coretypes.h (enum offload_memory): New.
	* doc/invoke.texi: Document -foffload-memory.

2022-03-09  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* omp-low.cc (scan_sharing_clauses): Handle OMP_CLAUSE_ALLOCATOR.
	(scan_omp_allocate): New.
	(scan_omp_1_stmt): Call it.
	(lower_omp_allocate): New function.
	(lower_omp_1): Call it.

2022-03-09  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* doc/gimple.texi: Describe GIMPLE_OMP_ALLOCATE.
	* gimple-pretty-print.cc (dump_gimple_omp_allocate): New function.
	(pp_gimple_stmt_1): Call it.
	* gimple.cc (gimple_build_omp_allocate): New function.
	* gimple.def (GIMPLE_OMP_ALLOCATE): New node.
	* gimple.h (enum gf_mask): Add GF_OMP_ALLOCATE_KIND_MASK,
	GF_OMP_ALLOCATE_KIND_ALLOCATE and GF_OMP_ALLOCATE_KIND_FREE.
	(struct gomp_allocate): New.
	(is_a_helper <gomp_allocate *>::test): New.
	(is_a_helper <const gomp_allocate *>::test): New.
	(gimple_build_omp_allocate): Declare.
	(gimple_omp_allocate_set_clauses): New.
	(gimple_omp_allocate_set_kind): Likewise.
	(gimple_omp_allocate_clauses): Likewise.
	(gimple_omp_allocate_kind): Likewise.
	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_ALLOCATE.
	* gimplify.cc (gimplify_omp_allocate): New.
	(gimplify_expr): Call it.
	* gsstruct.def (GSS_OMP_ALLOCATE): Define.

2022-01-08  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* tree-core.h (struct tree_base): Add comments.
	* tree-pretty-print.cc (dump_generic_node): Handle allocate directive
	kind.
	* tree.h (OMP_ALLOCATE_KIND_ALLOCATE): New define.
	(OMP_ALLOCATE_KIND_FREE): Likewise.

2022-03-09  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_ALLOCATOR.
	(dump_generic_node): Handle OMP_ALLOCATE.
	* tree.def (OMP_ALLOCATE): New.
	* tree.h (OMP_ALLOCATE_CLAUSES): Likewise.
	(OMP_ALLOCATE_DECL): Likewise.
	(OMP_ALLOCATE_ALLOCATOR): Likewise.
	* tree.cc (omp_clause_num_ops): Add entry for OMP_CLAUSE_ALLOCATOR.

2022-03-01  Tobias Burnus  <tobias@codesourcery.com>

	* langhooks-def.h (lhd_omp_deep_mapping_p,
	lhd_omp_deep_mapping_cnt, lhd_omp_deep_mapping): New.
	(LANG_HOOKS_OMP_DEEP_MAPPING_P, LANG_HOOKS_OMP_DEEP_MAPPING_CNT,
	LANG_HOOKS_OMP_DEEP_MAPPING): Define.
	(LANG_HOOKS_DECLS): Use it.
	* langhooks.cc (lhd_omp_deep_mapping_p, lhd_omp_deep_mapping_cnt,
	lhd_omp_deep_mapping): New stubs.
	* langhooks.h (struct lang_hooks_for_decls): Add new hooks
	* omp-expand.cc (expand_omp_target): Handle dynamic-size
	addr/sizes/kinds arrays.
	* omp-low.cc (build_sender_ref, fixup_child_record_type,
	scan_sharing_clauses, lower_omp_target): Update to handle
	new hooks and dynamic-size addr/sizes/kinds arrays.

2022-01-28  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (gimplify_omp_metadirective): Mark offloadable functions
	containing metadirectives with 'construct={target}' in the selector.
	* omp-general.cc (omp_has_target_constructor_p): New.
	* omp-general.h (omp_has_target_constructor_p): New prototype.
	* omp-low.cc (lower_omp_1): Emit warning if marked functions called
	outside of a target context.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* builtin-types.def (BT_FN_BOOL_INT_CONST_PTR_CONST_PTR_CONST_PTR): New
	type.
	* omp-builtins.def (BUILT_IN_GOMP_EVALUATE_TARGET_DEVICE): New builtin.
	* omp-general.cc (omp_context_selector_matches): Handle 'target_device'
	selector set.
	(omp_dynamic_cond): Generate expression tree for 'target_device'
	selector set.
	(omp_context_compute_score): Handle selectors in 'target_device' set.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.cc (omp_check_context_selector): Revert string length
	check.
	(omp_context_name_list_prop): Likewise.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* Makefile.in (OBJS): Add omp-expand-metadirective.o.
	* gimple-streamer-in.cc (input_gimple_stmt): Add case for
	GIMPLE_OMP_METADIRECTIVE.  Handle metadirective labels.
	* gimple-streamer-out.cc (output_gimple_stmt): Likewise.
	* omp-expand-metadirective.cc: New.
	* passes.def: Add pass_omp_expand_metadirective.
	* tree-pass.h (make_pass_omp_expand_metadirective): New prototype.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (expand_omp_metadirective): New.
	* omp-general.cc: Include tree-pretty-print.h.
	(DELAY_METADIRECTIVES_AFTER_LTO): New macro.
	(omp_context_selector_matches): Delay resolution of selectors.  Allow
	non-constant expressions.
	(omp_dynamic_cond): New.
	(omp_dynamic_selector_p): New.
	(sort_variant): New.
	(omp_get_dynamic_candidates): New.
	(omp_resolve_metadirective): New.
	(omp_resolve_metadirective): New.
	* omp-general.h (struct omp_metadirective_variant): New.
	(omp_resolve_metadirective): New prototype.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimple-low.cc (lower_omp_metadirective): New.
	(lower_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	* gimple-pretty-print.cc (dump_gimple_omp_metadirective): New.
	(pp_gimple_stmt_1): Handle GIMPLE_OMP_METADIRECTIVE.
	* gimple-walk.cc (walk_gimple_op): Handle GIMPLE_OMP_METADIRECTIVE.
	(walk_gimple_stmt): Likewise.
	* gimple.cc (gimple_alloc_omp_metadirective): New.
	(gimple_build_omp_metadirective): New.
	(gimple_build_omp_metadirective_variant): New.
	* gimple.def (GIMPLE_OMP_METADIRECTIVE): New.
	(GIMPLE_OMP_METADIRECTIVE_VARIANT): New.
	* gimple.h (gomp_metadirective_variant): New.
	(gomp_metadirective): New.
	(is_a_helper <gomp_metadirective *>::test): New.
	(is_a_helper <gomp_metadirective_variant *>::test): New.
	(is_a_helper <const gomp_metadirective *>::test): New.
	(is_a_helper <const gomp_metadirective_variant *>::test): New.
	(gimple_alloc_omp_metadirective): New prototype.
	(gimple_build_omp_metadirective): New prototype.
	(gimple_build_omp_metadirective_variant): New prototype.
	(gimple_has_substatements): Add GIMPLE_OMP_METADIRECTIVE case.
	(gimple_has_ops): Add GIMPLE_OMP_METADIRECTIVE.
	(gimple_omp_metadirective_label): New.
	(gimple_omp_metadirective_set_label): New.
	(gimple_omp_metadirective_variants): New.
	(gimple_omp_metadirective_set_variants): New.
	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_METADIRECTIVE.
	* gimplify.cc (is_gimple_stmt): Add OMP_METADIRECTIVE.
	(expand_omp_metadirective): New.
	(gimplify_omp_metadirective): New.
	(gimplify_expr): Add case for OMP_METADIRECTIVE.
	* gsstruct.def (GSS_OMP_METADIRECTIVE): New.
	(GSS_OMP_METADIRECTIVE_VARIANT): New.
	* omp-expand.cc (build_omp_regions_1): Handle GIMPLE_OMP_METADIRECTIVE.
	(omp_make_gimple_edges): Likewise.
	* omp-low.cc (struct omp_context): Add next_clone field.
	(new_omp_context): Initialize next_clone field.
	(clone_omp_context): New.
	(delete_omp_context): Delete clone contexts.
	(scan_omp_metadirective): New.
	(scan_omp_1_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	(lower_omp_metadirective): New.
	(lower_omp_1): Handle GIMPLE_OMP_METADIRECTIVE.
	* tree-cfg.cc (cleanup_dead_labels): Handle GIMPLE_OMP_METADIRECTIVE.
	(gimple_redirect_edge_and_branch): Likewise.
	* tree-inline.cc (remap_gimple_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	(estimate_num_insns): Likewise.
	* tree-pretty-print.cc (dump_generic_node): Handle OMP_METADIRECTIVE.
	* tree-ssa-operands.cc (parse_ssa_operands): Handle
	GIMPLE_OMP_METADIRECTIVE.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.cc (omp_context_selector_matches): Add extra argument.
	(omp_resolve_metadirective): New stub function.
	* omp-general.h (struct omp_metadirective_variant): New.
	(omp_context_selector_matches): Add extra argument.
	(omp_resolve_metadirective): New prototype.
	* tree.def (OMP_METADIRECTIVE): New.
	* tree.h (OMP_METADIRECTIVE_CLAUSES): New macro.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* graphite-scop-detection.cc (scop_detection::harmful_loop_in_region):
	Remove check for loops without data references.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* graphite-scop-detection.cc (scop_context_loop): New function.
	(build_alias_set): Use scop_context_loop instead of find_common_loop.
	* graphite-isl-ast-to-gimple.cc (graphite_regenerate_ast_isl): Likewise.
	* graphite.h (scop_context_loop): New declaration.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* graphite-optimize-isl.cc (optimize_isl): Adjust
	param_max_isl_operations value for OpenACC functions and add
	special warnings if value gets exceeded.

	* graphite-scop-detection.cc (build_scops): Likewise for
	param_graphite_max_arrays_per_scop.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* tree-ssa-pre.cc (insert): Skip any insertions in OpenACC
	functions that might be processed by Graphite.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* passes.def: Set restrict_oacc_hoisting to true for the early
	pass_lim instance.
	* tree-ssa-loop-im.cc (movement_possibility_1): Add
	restrict_oacc_hoisting flag to function; restrict movement if set.
	(movement_possibility): Add restrict_oacc_hoisting parameter.  Forward
	to movement_possibility_1.
	(compute_invariantness): Add restrict_oacc_hoisting flag and pass it on.
	(gather_mem_refs_stmt): Skip IFN_GOACC_LOOP and IFN_UNIQUE
	calls.
	(loop_invariant_motion_in_fun): Add restrict_oacc_hoisting flag and
	pass it on.
	(pass_lim::execute): Pass on new flags.
	* tree-ssa-loop-manip.h (loop_invariant_motion_in_fun): Adjust declaration.
	* gimple-loop-interchange.cc (pass_linterchange::execute): Adjust call to
	loop_invariant_motion_in_fun.

2021-11-16  Andrew Stubbs  <ams@codesourcery.com>

	* common.opt: Add flag Wopenacc-false-independent.
	* omp-offload.cc (oacc_loop_warn_if_false_independent): New function.
	(oacc_loop_fixed_partitions): Call from here.

2021-11-16  Andrew Stubbs  <ams@codesourcery.com>

	* graphite-isl-ast-to-gimple.cc: Include internal-fn.h.
	(graphite_oacc_analyze_scop): Implement runtime alias checks.
	* omp-expand.cc (expand_oacc_for): Add an additional "noalias" parameter
	to GOACC_LOOP internal calls, and initialise it to integer_one_node.
	* omp-offload.cc (oacc_xform_loop): Integrate the runtime alias check
	into the GOACC_LOOP expansion.

2021-11-16  Andrew Stubbs  <ams@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

	* Makefile.in: Add pass.
	* doc/gimple.texi: TODO.
	* gimple-walk.cc (walk_gimple_seq_mod): Adjust for backward walking.
	* gimple-walk.h (struct walk_stmt_info): Add field.
	* passes.def: Add new pass.
	* tree-pass.h (make_pass_omp_data_optimize): New declaration.
	* omp-data-optimize.cc: New file.

2021-11-16  Frederik Harwath <frederik@codesourcery.com>

	* tree-pretty-print.cc (print_omp_clause_to_str): Add new function.
	* tree-pretty-print.h (print_omp_clause_to_str): Add declaration.

2021-11-16  Frederik Harwath <frederik@codesourcery.com>

	* omp-offload.cc (oacc_remove_unused_partitioning): New function
	for removing partitioning that is not used by any loop.
	(oacc_validate_dims): Call oacc_remove_unused_partitioning and
	enable warnings about unused partitioning.

2021-11-16  Frederik Harwath <frederik@codesourcery.com>

	* graph.cc (oacc_get_fn_attrib): New declaration.
	(find_loop_location): New declaration.
	(draw_cfg_nodes_for_loop): Print value of the
	can_be_parallel flag at the top of loops in OpenACC
	functions.

2021-11-16  Frederik Harwath <frederik@codesourcery.com>
	    Thomas Schwinge <thomas@codesourcery.com>

            * Makefile.in: Add graphite-oacc.o
            * cfgloop.cc (alloc_loop): Set can_be_parallel_valid_p to false.
            * cfgloop.h: Add can_be_parallel_valid_p field.
            * cfgloopmanip.cc (copy_loop_info): Add assert.
            * config/nvptx/nvptx.cc (nvptx_goacc_reduction_setup):
            * doc/invoke.texi: Adjust param openacc-kernels description.
            * doc/passes.texi: Adjust pass_ipa_oacc_kernels description.
            * flag-types.h (enum openacc_kernels):Add
            OPENACC_KERNELS_DECOMPOSE_PARLOOPS.
            * gimple-pretty-print.cc (dump_gimple_omp_target): Handle
            GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE.
            * gimple.h (enum gf_mask): Add
            GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE and
            widen GF_OMP_TARGET_KIND_MASK.
            (is_gimple_omp_oacc): Handle
            GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE.
            (is_gimple_omp_offloaded): Likewise.
            * gimplify.cc (gimplify_omp_for): Enable reduction localization
            for "kernels" regions.
            (gimplify_omp_workshare): Likewise.
            * graphite-dependences.cc (scop_get_reads_and_writes): Handle
            "kills" and "reduction" PDRs.
            (apply_schedule_on_deps): Add dump output for intermediate
            steps of the dependence computation to enable understanding
            of unexpected dependences.
            (carries_deps): Likewise.
            (scop_get_dependences): Handle "kill" operations and add dump
            output.
            * graphite-isl-ast-to-gimple.cc (visit_schedule_loop_node): New function.
            (graphite_oacc_analyze_scop): New function.
            * graphite-optimize-isl.cc (optimize_isl): Remove "static" and
            add argument to identify OpenACC use; don't fail on unchanged
            schedule in this case.
            * graphite-poly.cc (new_poly_dr): Handle "kills".
            (print_pdr): Likewise.
            (new_gimple_poly_bb): Likewise.
            (free_gimple_poly_bb): Likewise.
            (new_scop): Handle "reduction", "private", and "firstprivate"
            hash sets.
            (free_scop): Likewise.
            (print_isl_space): New function.
            (debug_isl_space): New function.
            * graphite-scop-detection.cc (scop_detection::can_represent_loop):
            Don't fail if niter is 0 in OpenACC functions.
            (scop_detection::add_scop): Don't reject regions with only one
            loop in OpenACC functions.
            (ignored_oacc_internal_call_p): New function.
            (scan_tree_for_params): Handle VIEW_CONVERT_EXPR.
            (stmt_has_side_effects): Ignore internal OpenACC function calls.
            (add_write): Likewise.
            (add_read): Likewise.
            (add_kill): New function.
            (add_kills): New function.
            (add_oacc_kills): New function.
            (try_generate_gimple_bb): Kill false dependences for OpenACC
            "private"/"firstprivate" vars.
            (gather_bbs::gather_bbs): Determin OpenACC
            "private"/"firstprivate" vars in region.
            (gather_bbs::before_dom_children): Add assert.
            (determine_openacc_reductions): New function.
            (build_scops): Determine OpenACC "reduction" vars in SCoP.
            * graphite-sese-to-poly.cc (oacc_ifn_call_extract): New declaration.
            (oacc_internal_call_p): New function.
            (build_poly_dr): Ignore internal OpenACC function calls,
            handle "reduction" refs.
            (build_poly_sr): Likewise; handle "kill" operations.
            * graphite.cc (graphite_transform_loops): Accept functions with
            only a single loop.
            (oacc_enable_graphite_p): New function.
            (gate_graphite_transforms): Enable pass on OpenACC functions.
            * graphite.h (enum poly_dr_type): Add PDR_KILL.
            (struct poly_dr): Add "is_reduction" field.
            (new_poly_dr): Add argument to declaration.
            (pdr_kill_p): New function.
            (print_isl_space): New declaration.
            (debug_isl_space): New declaration.
            (struct scop): Add fields "reductions_vars",
            "oacc_firstprivate_vars", and "oacc_private_scalars".
            (optimize_isl): New declaration.
            (graphite_oacc_analyze_scop): New declaration.
            * internal-fn.cc (expand_UNIQUE): Handle
            IFN_UNIQUE_OACC_PRIVATE_SCALAR and IFN_UNIQUE_OACC_FIRSTPRIVATE
            * internal-fn.h: Add OACC_PRIVATE_SCALAR and OACC_FIRSTPRIVATE
            * omp-expand.cc (struct omp_region): Adjust comment.
            (expand_omp_taskloop_for_inner):
            (expand_omp_for): Add asserts about expected "kernels" region types.
            (mark_loops_in_oacc_kernels_region): Likewise.
            (expand_omp_target): Likewise; handle
            GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE.
            (build_omp_regions_1): Handle
            GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE.
            Likewise.
            (omp_make_gimple_edges): Likewise.
            * omp-general.cc (oacc_get_kernels_attrib): New function.
            (oacc_get_fn_dim_size): Allow argument to be NULL.
            * omp-general.h (oacc_get_kernels_attrib): New declaration.
            * omp-low.cc (struct omp_context): Add fields
            "oacc_firstprivate_vars" and "oacc_private_scalars".
            (was_originally_oacc_kernels): New function.
            (is_oacc_kernels):
            (is_oacc_kernels_decomposed_graphite_part): New function.
            (new_omp_context): Allocate "oacc_first_private_vars" and
            "oacc_private_scalars" ...
            (delete_omp_context): ... and free from here.
            (oacc_record_firstprivate_var_clauses): New function.
            (oacc_record_private_scalars): New function.
            (scan_sharing_clauses): Call functions to record "private"
            scalars and "firstprivate" variables.
            (check_oacc_kernel_gwv): Add assert.
            (ctx_in_oacc_kernels_region): Handle
            GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE.
            (scan_omp_for): Likewise.
            (check_omp_nesting_restrictions): Likewise.
            (lower_oacc_head_mark): Likewise.
            (lower_omp_for): Likewise.
            (lower_omp_target): Create "private" and "firstprivate" marker
            call statements.
            (lower_oacc_head_tail): Adjust "private" and "firstprivate"
            marker calls.
            (lower_oacc_reductions): Emit "private" and "firstprivate"
             marker call statements.
            (make_oacc_firstprivate_vars_marker): New function.
            (make_oacc_private_scalars_marker): New function.
            * omp-oacc-kernels-decompose.cc (adjust_region_code_walk_stmt_fn):
            Assign GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE to
            region using the new "kernels" handling.
            (make_region_seq): Adjust default region type for new
            "kernels" handling; no more exceptions, let Graphite handle everything.
            (make_region_loop_nest): Likewise; add dump output and assert.
            (adjust_nested_loop_clauses): Stop creating "auto" clauses if
            loop has "independent", "gang" etc.
            (transform_kernels_loop_clauses): Likewise.
            * omp-offload.cc (oacc_extract_loop_call): New function.
            (oacc_loop_get_cfg_loop): New function.
            (can_be_parallel_str): New function.
            (oacc_loop_can_be_parallel_p): New function.
            (oacc_parallel_kernels_graphite_fun_p): New function.
            (oacc_parallel_fun_p): New function.
            (oacc_loop_transform_auto_into_independent): New function, ...
            (oacc_loop_fixed_partitions): ... called from here to transfer
            the result of Graphite's analysis to the loop.
            (execute_oacc_loop_designation): Handle "oacc
            functions with "parallel_kernels_graphite" attribute.
            (execute_oacc_device_lower): Handle
            IFN_UNIQUE_OACC_PRIVATE_SCALAR and IFN_UNIQUE_OACC_FIRSTPRIVATE.
            * omp-offload.h (oacc_extract_loop_call): Add declaration.
            * params.opt: Add "param=openacc-kernels" value "decompose-parloops".
            * sese.cc (scalar_evolution_in_region): "Redirect" SCEV
            analysis to outer loop for IFN_GOACC_LOOP calls.
            * sese.h: Add field "kill_scalar_refs".
            * tree-chrec.cc (chrec_fold_plus_1): Handle VIEW_CONVERT_EXPR
            like CASE_CONVERT.
            * tree-data-ref.cc (dump_data_reference): Include
            DR_BASE_ADDRESS and DR_OFFSET in dump output.
            (get_references_in_stmt): Don't reject OpenACC internal function
            calls.
            (graphite_find_data_references_in_stmt): Remove unused variable.
            * tree-parloops.cc (pass_parallelize_loops::execute): Disable
            pass with the new kernels handling, enable if requested explicitly.
            * tree-scalar-evolution.cc (set_scev_analyze_openacc_calls):
            Set flag to enable the analysis of internal OpenACC function
            calls (use for Graphite only).
            (oacc_call_analyzable_p): New function.
            (oacc_ifn_call_extract): New function.
            (oacc_simplify): New function.
            (add_to_evolution): Simplify OpenACC internal function calls
            if applicable.
            (follow_ssa_edge_binary): Likewise.
            (follow_ssa_edge_expr): Likewise.
            (follow_copies_to_constant): Likewise.
            (analyze_initial_condition): Likewise.
            (interpret_loop_phi): Likewise.
            (interpret_gimple_call): New function.
            (interpret_rhs_expr): Likewise.
            (instantiate_scev_name): Likewise.
            (analyze_scalar_evolution_1): Handle GIMPLE_CALL, handle default definitions.
            (expression_expensive_p): Consider internal OpenACC calls to
            be cheap.
            * tree-scalar-evolution.h (set_scev_analyze_openacc_calls):
            New declaration.
            (oacc_call_analyzable_p): New declaration.
            * tree-ssa-dce.cc (mark_stmt_if_obviously_necessary): Mark
            lhs of internal OpenACC function calls necessary.
            * tree-ssa-ifcombine.c (recognize_if_then_else):
            * tree-ssa-loop-niter.cc (oacc_call_analyzable_p):
            (oacc_ifn_call_extract): New declaration.
            (interpret_gimple_call): New delcaration.
            (expand_simple_operations): Handle internal OpenACC function calls.
            * tree-ssa-loop.cc (gate_oacc_kernels): Disable for new
            "kernels" handling.
            * graphite-oacc.cc: New file.
            * graphite-oacc.h: New file.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* common.opt: Add fgraphite-runtime-alias-checks.
	* graphite-isl-ast-to-gimple.cc
	(generate_alias_cond): New function.
	(graphite_regenerate_ast_isl): Use from here.
	* graphite-poly.cc (new_scop): Create unhandled_alias_ddrs vec ...
	(free_scop): and release here.
	* graphite-scop-detection.cc (dr_defs_outside_region): New function.
	(dr_well_analyzed_for_runtime_alias_check_p): New function.
	(graphite_runtime_alias_check_p): New function.
	(build_alias_set): Record unhandled alias ddrs for later alias check
	creation if flag_graphite_runtime_alias_checks is true instead
	of failing.
	* graphite.h (struct scop): Add field unhandled_alias_ddrs.
	* sese.h (has_operands_from_region_p): New function.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* tree-loop-distribution.cc (data_ref_segment_size): Remove function.
	(latch_dominated_by_data_ref): Likewise.
	(compute_alias_check_pairs): Likewise.

	* tree-data-ref.cc (data_ref_segment_size): New function,
	copied from tree-loop-distribution.c
	(compute_alias_check_pairs): Likewise.
	(latch_dominated_by_data_ref): Likewise.

	* tree-data-ref.h (compute_alias_check_pairs): New declaration.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* predict.cc (pass_profile::execute): Fix dump message.

2021-11-16  Frederik Harwath <frederik@codesourcery.com>
	    Thomas Schwinge <thomas@codesourcery.com>

	* omp-general.cc (oacc_get_fn_dim_size): Return 0 on
	missing "dims".
	* omp-offload.cc (pass_oacc_loop_designation::clone): New
	member function.
	(pass_oacc_gimple_workers::clone): Likewise.
	(pass_oacc_gimple_device_lower::clone): Likewise.
	* passes.cc (pass_data_no_loop_optimizations): New pass_data.
	(class pass_no_loop_optimizations): New pass.
	(make_pass_no_loop_optimizations): New function.
	* passes.def: Move pass_oacc_{loop_designation,
	gimple_workers, device_lower} into tree_loop, and add
	copies to pass_tree_no_loop and to new
	pass_no_loop_optimizations.  Add copies of passes pass_ccp,
	pass_ipa_warn, pass_complete_unrolli, pass_backprop,
	pass_phiprop, pass_fix_loops after the OpenACC passes
	in pass_tree_loop.
	* tree-ssa-loop-ivcanon.cc (pass_complete_unroll::clone):
	New member function.
	(pass_complete_unrolli::clone): Likewise.
	* tree-ssa-loop.cc (pass_fix_loops::clone): Likewise.
	(pass_tree_loop_init::clone): Likewise.
	(pass_tree_loop_done::clone): Likewise.
	* tree-ssa-phiprop.cc (pass_phiprop::clone): Likewise.

2021-11-16  Sandra Loosemore <sandra@codesourcery.com>
	    Tobias Burnus  <tobias@codesourcery.com>

	* expr.cc (get_inner_reference): Handle NOP_EXPR like
	VIEW_CONVERT_EXPR.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* tree-cfg.h (gimple_debug_cfg): Change argument type from int
	to dump_flags_t.

2021-04-07  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-low.cc (is_oacc_parallel_or_serial): Handle
	GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED and
	GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE.

2021-03-04  Andrew Stubbs <ams@codesourcery.com>

	* dwarf2out.cc (notional_parents_list): New file variable.
	(gen_subprogram_die): Record offload kernel functions in
	notional_parents_list.
	(fixup_notional_parents): New function.
	(dwarf2out_finish): Call fixup_notional_parents.
	(dwarf2out_c_finalize): Reset notional_parents_list.

2021-03-01  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-expand.cc (expand_oacc_for): Convert .tile variable to
	diff_type before multiplying.
	* omp-general.cc (omp_extract_for_data): Use accumulated precision
	of all collapsed for-loops as precision of iteration variable, up
	to the precision of a long long.

2021-02-26  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (gen_subprogram_die): Replace existing low/high PC
	attributes, rather than ICE.

2021-02-01  Chung-Lin Tang  <cltang@codesourcery.com>

	* omp-low.cc (install_var_field): Add new 'tree key_expr = NULL_TREE'
	default parameter. Set splay-tree lookup key to key_expr instead of
	var if key_expr is non-NULL. Adjust call to install_parm_decl.
	Update comments.
	(scan_sharing_clauses): Use clause tree expression as splay-tree key
	for map/to/from and OpenACC firstprivate cases when installing the
	variable field into the send/receive record type.
	(maybe_lookup_field_in_outer_ctx): Add code to search through
	construct clauses instead of entirely based on splay-tree lookup.
	(lower_oacc_reductions): Adjust to find map-clause of reduction
	variable, then create receiver-ref.
	(lower_omp_target): Adjust to lookup var field using clause expression.

2021-01-16  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (gen_subprogram_die): Check offload attributes only.

2021-01-15  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (add_location_or_const_value_attribute): Set
	DW_AT_address_class, if appropriate.

2020-12-06  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (gen_subprogram_die): Add high/low_pc attributes for
	parents of offload kernels.

2021-01-13  Julian Brown  <julian@codesourcery.com>

	* doc/tm.texi.in (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Add
	documentation hook.
	* doc/tm.texi: Regenerate.
	* target.def (prefer_gather_scatter): Add target hook under vectorizer.
	* tree-vect-stmts.cc (get_group_load_store_type): Optionally prefer
	gather/scatter instructions to scalar/elementwise fallback.
	* config/gcn/gcn.cc (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Define
	hook.

2021-01-13  Julian Brown  <julian@codesourcery.com>

	* omp-offload.cc (oacc_thread_numbers): Add VF_BY_VECTORIZER parameter.
	Add overloaded wrapper for previous arguments & behaviour.
	(oacc_xform_loop): Lower vector loops to iterate a multiple of
	omp_max_vf times over contiguous steps on non-SIMT targets.

2020-08-19  Sandra Loosemore  <sandra@codesourcery.com>

	Add a "combined" flag for "acc kernels loop" etc directives.

	* tree.h (OACC_LOOP_COMBINED): New.

2020-06-03  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (localize_reductions): Do not create local
	variable for privatized arrays.

2020-03-27  Sandra Loosemore  <sandra@codesourcery.com>

	* doc/invoke.texi (Option Summary): Add entries for
	-Wopenacc-kernels-annotate-loops and
	-fno-openacc-kernels-annotate-loops.
	(Warning Options): Document -Wopenacc-kernels-annotate-loops.
	(Optimization Options): Document -fno-openacc-kernels-annotate-loops.

2020-02-06  Tobias Burnus  <tobias@codesourcery.com>

	* omp-low.c (convert_from_firstprivate_int):
	Use VIEW_CONVERT also for vectors.

2020-02-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_scan_omp_clauses): Handle
	GOMP_MAP_DECLARE_ALLOCATE and GOMP_MAP_DECLARE_DEALLOCATE.

2018-10-04  Cesar Philippidis  <cesar@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* omp-low.c (scan_sharing_clauses): Update handling of OpenACC declare
	create, declare copyin and declare deviceptr to have local lifetimes.
	(convert_to_firstprivate_int): Handle pointer types.
	(convert_from_firstprivate_int): Likewise.  Create local storage for
	the values being pointed to.  Add new orig_type argument.
	(lower_omp_target): Handle GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}.
	Add orig_type argument to convert_from_firstprivate_int call.
	Allow pointer types with GOMP_MAP_FIRSTPRIVATE_INT.  Don't privatize
	firstprivate VLAs.
	* tree-pretty-print.c (dump_omp_clause): Handle
	GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}.

2019-09-20  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (localize_reductions): Rewrite references for
	OMP_CLAUSE_PRIVATE also.

2019-09-17  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (gomp_oacc_needs_data_present): Remove unused variable.

2019-09-06  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_omp_for): Use for_stmt in call to
	localize_reductions.

2019-09-06  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_omp_workshare): Use OMP_CLAUSES, OMP_BODY
	instead of OMP_TARGET_CLAUSES, OMP_TARGET_BODY.

2019-09-05  Cesar Philippidis  <cesar@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (privatize_reduction): New struct.
	(localize_reductions_r, localize_reductions): New functions.
	(gimplify_omp_for): Call localize_reductions.
	(gimplify_omp_workshare): Likewise.
	* omp-low.cc (lower_oacc_reductions): Handle localized reductions.
	Create fewer temp vars.
	* tree-core.h (omp_clause_code): Add OMP_CLAUSE_REDUCTION_PRIVATE_DECL
	documentation.
	* tree.cc (omp_clause_num_ops): Bump number of ops for
	OMP_CLAUSE_REDUCTION to 6.
	(walk_tree_1): Adjust accordingly.
	* tree.h (OMP_CLAUSE_REDUCTION_PRIVATE_DECL): Add macro.

2019-07-10  Cesar Philippidis  <cesar@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Raise error for
	assumed-size arrays in map clauses for Fortran/OpenMP.
	* omp-low.cc (lower_omp_target): Set the size of assumed-size Fortran
	arrays to one to allow use of data already mapped on the offload device.

2019-05-20  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Support implied no_alloc
	and optional arguments based on mappings in enclosing data regions.

2019-05-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (oacc_array_mapping_info): Add REF field.
	(gimplify_scan_omp_clauses): Initialise above field for data blocks
	passed by reference.
	(gomp_oacc_needs_data_present): Handle references.
	(gimplify_adjust_omp_clauses_1): Handle references and optional
	arguments for variables declared in lexically-enclosing OpenACC data
	region.

2019-01-23  Thomas Schwinge  <thomas@codesourcery.com>

	* params.opt (openacc_kernels): Default to decompose.

2018-09-05  Cesar Philippidis  <cesar@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	* gimplify.cc (omp_add_variable): Enable firstprivate reduction
	variables.

2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>

	* omp-low.cc (lower_oacc_head_mark): Don't mark OpenACC auto
	loops as independent inside acc parallel regions.

2018-12-22  Cesar Philippidis  <cesar@codesourcery.com>
            Julian Brown  <julian@codesourcery.com>
            Tobias Burnus  <tobias@codesourcery.com>

	* omp-low.cc (maybe_lookup_field_in_outer_ctx): New function.
	(convert_to_firstprivate_int): New function.
	(convert_from_firstprivate_int): New function.
	(lower_omp_target): Enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC.
	Remove unused variable.

2018-08-28  Julian Brown  <julian@codesourcery.com>
            Cesar Philippidis  <cesar@codesourcery.com>

	* gimplify.cc (oacc_array_mapping_info): New struct.
	(gimplify_omp_ctx): Add decl_data_clause hash map.
	(new_omp_context): Zero-initialise above.
	(delete_omp_context): Delete above if allocated.
	(gimplify_scan_omp_clauses): Scan for array mappings on data constructs,
	and record in above map.
	(gomp_oacc_needs_data_present): New function.
	(gimplify_adjust_omp_clauses_1): Handle data mappings (e.g. array
	slices) declared in lexically-enclosing data constructs.
	* omp-low.cc (lower_omp_target): Allow decl for bias not to be present
	in OpenACC context.

2018-10-05  Nathan Sidwell  <nathan@acm.org>
	    Tom de Vries  <tdevries@suse.de>
	    Thomas Schwinge  <thomas@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* doc/invoke.texi (fopenacc-dim): Update.
	* omp-offload.cc (oacc_parse_default_dims): Update.

2019-09-20  Chung-Lin Tang <cltang@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	* omp-expand.cc (struct omp_region): Add inside_kernels_p field.
	(expand_omp_for_generic): Adjust to generate a 'sequential' loop
	when GOMP builtin arguments are BUILT_IN_NONE.
	(expand_omp_for): Use expand_omp_for_generic to generate a
	non-parallelized loop for OMP_FORs inside OpenACC kernels regions.
	(expand_omp): Mark inside_kernels_p field true for regions
	nested inside OpenACC kernels constructs.

2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* omp-low.c (install_var_field): New base_pointer_restrict
	argument.
	(scan_sharing_clauses): Update call to install_var_field.
	(omp_target_base_pointers_restrict_p): New function.
	(scan_omp_target): Update call to install_var_field.

2018-10-30  Cesar Philippidis  <cesar@codesourcery.com>

	* config/nvptx/nvptx.cc (nvptx_propagate_unified): New.
	(nvptx_split_blocks): Call it for cond_uni insn.
	(nvptx_expand_cond_uni): New.
	(enum nvptx_builtins): Add NVPTX_BUILTIN_COND_UNI.
	(nvptx_init_builtins): Initialize it.
	(nvptx_expand_builtin):
	(nvptx_generate_vector_shuffle): Change integral SHIFT operand to
	tree BITS operand.
	(nvptx_vector_reduction): New.
	(nvptx_adjust_reduction_type): New.
	(nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res.
	(nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist.
	(nvptx_goacc_reduction_fini): Call nvptx_vector_reduction for vector.
	Use it to adjust the type of ref_to_res.
	(nvptx_goacc_reduction_teardown):
	* config/nvptx/nvptx.md (cond_uni): New pattern.

2018-06-29  Cesar Philippidis  <cesar@codesourcery.com>
	    James Norris  <jnorris@codesourcery.com>

	* gimplify.cc (enum gimplify_omp_var_data): Add GOVD_DEVICETPR.
	(omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate.
	(gimplify_scan_omp_clauses): Add GOVD_DEVICEPTR attribute when
	appropriate.
	(gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for
	implicit deviceptr mappings.

2020-04-19  Chung-Lin Tang  <cltang@codesourcery.com>

	PR other/76739

	* builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR): New type.
	* omp-builtins.def (BUILT_IN_GOACC_DATA_START): Adjust function type
	to new BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR.
	* gimplify.cc (gimplify_scan_omp_clauses): Skip gimplification of
	OMP_CLAUSE_SIZE of non-contiguous array maps (which is a TREE_LIST).
	* omp-expand.cc (expand_omp_target): Add non-contiguous array descriptor
	pointers to variadic arguments.
	* omp-low.cc (append_field_to_record_type): New function.
	(create_noncontig_array_descr_type): Likewise.
	(create_noncontig_array_descr_init_code): Likewise.
	(scan_sharing_clauses): For non-contiguous array map kinds, check for
	supported dimension structure, and install non-contiguous array
	variable into current omp_context.
	(reorder_noncontig_array_clauses): New function.
	(scan_omp_target): Call reorder_noncontig_array_clauses to place
	non-contiguous array map clauses at beginning of clause sequence.
	(lower_omp_target): Add handling for non-contiguous array map kinds,
	add all created non-contiguous array descriptors to
	gimple_omp_target_data_arg.

2022-06-20  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* Makefile.in (REVISION_s): Change default message.