File: IRNode.java

package info (click to toggle)
openjdk-25 25.0.1%2B8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 825,408 kB
  • sloc: java: 5,585,680; cpp: 1,333,948; xml: 1,321,242; ansic: 488,034; asm: 404,003; objc: 21,088; sh: 15,106; javascript: 13,265; python: 8,319; makefile: 2,518; perl: 357; awk: 351; pascal: 103; exp: 83; sed: 72; jsp: 24
file content (3225 lines) | stat: -rw-r--r-- 117,438 bytes parent folder | download | duplicates (2)
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
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
/*
 * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package compiler.lib.ir_framework;

import compiler.lib.ir_framework.driver.irmatching.mapping.*;
import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo;
import compiler.lib.ir_framework.shared.CheckedTestFrameworkException;
import compiler.lib.ir_framework.shared.TestFormat;
import compiler.lib.ir_framework.shared.TestFormatException;
import jdk.test.lib.Platform;
import jdk.test.whitebox.WhiteBox;

import java.util.HashMap;
import java.util.Map;

/**
 * This class specifies IR node placeholder strings (also referred to as just "IR nodes") with mappings to regexes
 * depending on the selected compile phases. The mappings are stored in {@link #IR_NODE_MAPPINGS}. Each IR node
 * placeholder string is mapped to a {@link IRNodeMapEntry} instance defined in
 * {@link compiler.lib.ir_framework.driver.irmatching.mapping}.
 *
 * <p>
 * IR node placeholder strings can be used in {@link IR#failOn()} and/or {@link IR#counts()} attributes to define IR
 * constraints. They usually represent a single C2 IR node or a group of them.
 *
 * <p>
 * Each IR node placeholder string is accompanied by a static block that defines an IR node placeholder to regex(es)
 * mapping. The IR framework will automatically replace each IR node placeholder string in a user defined test with a
 * regex depending on the selected compile phases in {@link IR#phase} and the provided mapping.
 *
 * <p>
 * Each mapping must define a default compile phase which is applied when the user does not explicitly set the
 * {@link IR#phase()} attribute or when directly using {@link CompilePhase#DEFAULT}. In this case, the IR framework
 * falls back on the default compile phase of any {@link IRNodeMapEntry}.
 *
 * <p>
 * The IR framework reports a {@link TestFormatException} if:
 * <ul>
 *     <li><p> A user test specifies a compile phase for which no mapping is defined in this class.</li>
 *     <li><p> An IR node placeholder string is either missing a mapping or does not provide a regex for a specified
 *             compile phase in {@link IR#phase}.
 * </ul>
 *
 * <p>
 * There are two types of IR nodes:
 * <ul>
 *     <li><p>Normal IR nodes: The IR node placeholder string is directly replaced by a regex.</li>
 *     <li><p>Composite IR nodes:  The IR node placeholder string contains an additional {@link #COMPOSITE_PREFIX}.
 *                                 Using this IR node expects another user provided string in the constraint list of
 *                                 {@link IR#failOn()} and {@link IR#counts()}. They cannot be used as normal IR nodes.
 *                                 Trying to do so will result in a format violation error.</li>
 *     <li><p>Vector IR nodes:  The IR node placeholder string contains an additional {@link #VECTOR_PREFIX}.
 *                              Using this IR node, one can check for the type and size of a vector. The type must
 *                              be directly specified in {@link #vectorNode}. The size can be specified directly with
 *                              an additional argument using {@link #VECTOR_SIZE}, followed by a size tag or a comma
 *                              separated list of sizes. If the size argument is not given, then a default size of
 *                              {@link #VECTOR_SIZE_MAX} is taken, which is the number of elements that can fit in a
 *                              vector of the specified type (depends on the VM flag MaxVectorSize and CPU features).
 *                              However, when using {@link IR#failOn} or {@link IR#counts()} with comparison {@code <},
 *                              or {@code <=} or {@code =0}, the default size is {@link #VECTOR_SIZE_ANY}, allowing any
 *                              size. The motivation for these default values is that in most cases one wants to have
 *                              vectorization with maximal vector width, or no vectorization of any vector width.
 * </ul>
 */
public class IRNode {
    /**
     * Prefix for normal IR nodes.
     */
    private static final String PREFIX = "_#";
    /**
     * Prefix for composite IR nodes.
     */
    private static final String COMPOSITE_PREFIX = PREFIX + "C#";
    /**
     * Prefix for vector IR nodes.
     */
    private static final String VECTOR_PREFIX = PREFIX + "V#";

    private static final String POSTFIX = "#_";

    private static final String START = "(\\d+(\\s){2}(";
    private static final String MID = ".*)+(\\s){2}===.*";
    private static final String END = ")";
    private static final String STORE_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END;
    private static final String LOAD_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END;

    public static final String IS_REPLACED = "#IS_REPLACED#"; // Is replaced by an additional user-defined string.

    public static final String VECTOR_SIZE = "_@";
    public static final String VECTOR_SIZE_TAG_ANY = "any";
    public static final String VECTOR_SIZE_TAG_MAX = "max_for_type";
    public static final String VECTOR_SIZE_ANY = VECTOR_SIZE + VECTOR_SIZE_TAG_ANY; // default for counts "=0" and failOn
    public static final String VECTOR_SIZE_MAX = VECTOR_SIZE + VECTOR_SIZE_TAG_MAX; // default in counts
    public static final String VECTOR_SIZE_2   = VECTOR_SIZE + "2";
    public static final String VECTOR_SIZE_4   = VECTOR_SIZE + "4";
    public static final String VECTOR_SIZE_8   = VECTOR_SIZE + "8";
    public static final String VECTOR_SIZE_16  = VECTOR_SIZE + "16";
    public static final String VECTOR_SIZE_32  = VECTOR_SIZE + "32";
    public static final String VECTOR_SIZE_64  = VECTOR_SIZE + "64";

    private static final String TYPE_BYTE   = "B";
    private static final String TYPE_CHAR   = "C";
    private static final String TYPE_SHORT  = "S";
    private static final String TYPE_INT    = "I";
    private static final String TYPE_LONG   = "J";
    private static final String TYPE_FLOAT  = "F";
    private static final String TYPE_DOUBLE = "D";

    /**
     * IR placeholder string to regex-for-compile-phase map.
     */
    private static final Map<String, IRNodeMapEntry> IR_NODE_MAPPINGS = new HashMap<>();

    /**
     * Map every vectorNode to a type string.
     */
    private static final Map<String, String> VECTOR_NODE_TYPE = new HashMap<>();

    /*
     * Start of IR placeholder string definitions followed by a static block defining the regex-for-compile-phase mapping.
     * An IR node placeholder string must start with PREFIX for normal IR nodes or COMPOSITE_PREFIX for composite IR
     * nodes, or VECTOR_PREFIX for vector nodes (see class description above).
     *
     * An IR node definition looks like this:
     *
     * public static final String IR_NODE = [PREFIX|COMPOSITE_PREFIX|VECTOR_PREFIX] + "IR_NODE" + POSTFIX;
     * static {
     *    // Define IR_NODE to regex-for-compile-phase mapping. Create a new IRNodeMapEntry object and add it to
     *    // IR_NODE_MAPPINGS. This can be done by using the helper methods defined after all IR node placeholder string
     *    // definitions.
     * }
     */

    public static final String ABS_D = PREFIX + "ABS_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(ABS_D, "AbsD");
    }

    public static final String ABS_F = PREFIX + "ABS_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(ABS_F, "AbsF");
    }

    public static final String ABS_I = PREFIX + "ABS_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(ABS_I, "AbsI");
    }

    public static final String ABS_L = PREFIX + "ABS_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(ABS_L, "AbsL");
    }

    public static final String ABS_VB = VECTOR_PREFIX + "ABS_VB" + POSTFIX;
    static {
        vectorNode(ABS_VB, "AbsVB", TYPE_BYTE);
    }

    // ABS_VC / AbsVC does not exist (char is 2 byte unsigned)

    public static final String ABS_VS = VECTOR_PREFIX + "ABS_VS" + POSTFIX;
    static {
        vectorNode(ABS_VS, "AbsVS", TYPE_SHORT);
    }

    public static final String ABS_VI = VECTOR_PREFIX + "ABS_VI" + POSTFIX;
    static {
        vectorNode(ABS_VI, "AbsVI", TYPE_INT);
    }

    public static final String ABS_VL = VECTOR_PREFIX + "ABS_VL" + POSTFIX;
    static {
        vectorNode(ABS_VL, "AbsVL", TYPE_LONG);
    }

    public static final String ABS_VF = VECTOR_PREFIX + "ABS_VF" + POSTFIX;
    static {
        vectorNode(ABS_VF, "AbsVF", TYPE_FLOAT);
    }

    public static final String ABS_VD = VECTOR_PREFIX + "ABS_VD" + POSTFIX;
    static {
        vectorNode(ABS_VD, "AbsVD", TYPE_DOUBLE);
    }

    public static final String ADD = PREFIX + "ADD" + POSTFIX;
    static {
        beforeMatchingNameRegex(ADD, "Add(I|L|F|D|P)");
    }

    public static final String ADD_F = PREFIX + "ADD_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(ADD_F, "AddF");
    }

    public static final String ADD_I = PREFIX + "ADD_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(ADD_I, "AddI");
    }

    public static final String ADD_L = PREFIX + "ADD_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(ADD_L, "AddL");
    }

    public static final String ADD_HF = PREFIX + "ADD_HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(ADD_HF, "AddHF");
    }

    public static final String ADD_P = PREFIX + "ADD_P" + POSTFIX;
    static {
        beforeMatchingNameRegex(ADD_P, "AddP");
    }

    public static final String ADD_VD = VECTOR_PREFIX + "ADD_VD" + POSTFIX;
    static {
        vectorNode(ADD_VD, "AddVD", TYPE_DOUBLE);
    }

    public static final String ADD_VI = VECTOR_PREFIX + "ADD_VI" + POSTFIX;
    static {
        vectorNode(ADD_VI, "AddVI", TYPE_INT);
    }

    public static final String ADD_VHF = VECTOR_PREFIX + "ADD_VHF" + POSTFIX;
    static {
        vectorNode(ADD_VHF, "AddVHF", TYPE_SHORT);
    }

    public static final String ADD_VF = VECTOR_PREFIX + "ADD_VF" + POSTFIX;
    static {
        vectorNode(ADD_VF, "AddVF", TYPE_FLOAT);
    }

    public static final String ADD_VB = VECTOR_PREFIX + "ADD_VB" + POSTFIX;
    static {
        vectorNode(ADD_VB, "AddVB", TYPE_BYTE);
    }

    public static final String ADD_VS = VECTOR_PREFIX + "ADD_VS" + POSTFIX;
    static {
        vectorNode(ADD_VS, "AddVS", TYPE_SHORT);
    }

    public static final String ADD_VL = VECTOR_PREFIX + "ADD_VL" + POSTFIX;
    static {
        vectorNode(ADD_VL, "AddVL", TYPE_LONG);
    }

    public static final String SATURATING_ADD_VB = VECTOR_PREFIX + "SATURATING_ADD_VB" + POSTFIX;
    static {
        vectorNode(SATURATING_ADD_VB, "SaturatingAddV", TYPE_BYTE);
    }

    public static final String SATURATING_ADD_VS = VECTOR_PREFIX + "SATURATING_ADD_VS" + POSTFIX;
    static {
        vectorNode(SATURATING_ADD_VS, "SaturatingAddV", TYPE_SHORT);
    }

    public static final String SATURATING_ADD_VI = VECTOR_PREFIX + "SATURATING_ADD_VI" + POSTFIX;
    static {
        vectorNode(SATURATING_ADD_VI, "SaturatingAddV", TYPE_INT);
    }

    public static final String SATURATING_ADD_VL = VECTOR_PREFIX + "SATURATING_ADD_VL" + POSTFIX;
    static {
        vectorNode(SATURATING_ADD_VL, "SaturatingAddV", TYPE_LONG);
    }

    public static final String SATURATING_SUB_VB = VECTOR_PREFIX + "SATURATING_SUB_VB" + POSTFIX;
    static {
        vectorNode(SATURATING_SUB_VB, "SaturatingSubV", TYPE_BYTE);
    }

    public static final String SATURATING_SUB_VS = VECTOR_PREFIX + "SATURATING_SUB_VS" + POSTFIX;
    static {
        vectorNode(SATURATING_SUB_VS, "SaturatingSubV", TYPE_SHORT);
    }

    public static final String SATURATING_SUB_VI = VECTOR_PREFIX + "SATURATING_SUB_VI" + POSTFIX;
    static {
        vectorNode(SATURATING_SUB_VI, "SaturatingSubV", TYPE_INT);
    }

    public static final String SATURATING_SUB_VL = VECTOR_PREFIX + "SATURATING_SUB_VL" + POSTFIX;
    static {
        vectorNode(SATURATING_SUB_VL, "SaturatingSubV", TYPE_LONG);
    }

    public static final String ADD_REDUCTION_V = PREFIX + "ADD_REDUCTION_V" + POSTFIX;
    static {
        beforeMatchingNameRegex(ADD_REDUCTION_V, "AddReductionV(B|S|I|L|F|D)");
    }

    public static final String ADD_REDUCTION_VD = PREFIX + "ADD_REDUCTION_VD" + POSTFIX;
    static {
        superWordNodes(ADD_REDUCTION_VD, "AddReductionVD");
    }

    public static final String ADD_REDUCTION_VF = PREFIX + "ADD_REDUCTION_VF" + POSTFIX;
    static {
        superWordNodes(ADD_REDUCTION_VF, "AddReductionVF");
    }

    public static final String ADD_REDUCTION_VI = PREFIX + "ADD_REDUCTION_VI" + POSTFIX;
    static {
        superWordNodes(ADD_REDUCTION_VI, "AddReductionVI");
    }

    public static final String ADD_REDUCTION_VL = PREFIX + "ADD_REDUCTION_VL" + POSTFIX;
    static {
        superWordNodes(ADD_REDUCTION_VL, "AddReductionVL");
    }

    public static final String OPAQUE_MULTIVERSIONING = PREFIX + "OPAQUE_MULTIVERSIONING" + POSTFIX;
    static {
        beforeMatchingNameRegex(OPAQUE_MULTIVERSIONING, "OpaqueMultiversioning");
    }

    public static final String REARRANGE_VB = VECTOR_PREFIX + "REARRANGE_VB" + POSTFIX;
    static {
        vectorNode(REARRANGE_VB, "VectorRearrange", TYPE_BYTE);
    }

    public static final String REARRANGE_VS = VECTOR_PREFIX + "REARRANGE_VS" + POSTFIX;
    static {
        vectorNode(REARRANGE_VS, "VectorRearrange", TYPE_SHORT);
    }

    public static final String REARRANGE_VI = VECTOR_PREFIX + "REARRANGE_VI" + POSTFIX;
    static {
        vectorNode(REARRANGE_VI, "VectorRearrange", TYPE_INT);
    }

    public static final String REARRANGE_VL = VECTOR_PREFIX + "REARRANGE_VL" + POSTFIX;
    static {
        vectorNode(REARRANGE_VL, "VectorRearrange", TYPE_LONG);
    }

    public static final String REARRANGE_VF = VECTOR_PREFIX + "REARRANGE_VF" + POSTFIX;
    static {
        vectorNode(REARRANGE_VF, "VectorRearrange", TYPE_FLOAT);
    }

    public static final String REARRANGE_VD = VECTOR_PREFIX + "REARRANGE_VD" + POSTFIX;
    static {
        vectorNode(REARRANGE_VD, "VectorRearrange", TYPE_DOUBLE);
    }

    public static final String ADD_P_OF = COMPOSITE_PREFIX + "ADD_P_OF" + POSTFIX;
    static {
        String regex = START + "addP_" + IS_REPLACED + MID + ".*" + END;
        machOnly(ADD_P_OF, regex);
    }

    public static final String ALLOC = PREFIX + "ALLOC" + POSTFIX;
    static {
        String regex = START + "Allocate\\b" + MID + END;
        macroNodes(ALLOC, regex);
    }

    public static final String ALLOC_OF = COMPOSITE_PREFIX + "ALLOC_OF" + POSTFIX;
    static {
        String regex = START + "Allocate\\b" + MID + "allocationKlass:.*\\b" + IS_REPLACED + "\\s.*" + END;
        macroNodes(ALLOC_OF, regex);
    }

    public static final String ALLOC_ARRAY = PREFIX + "ALLOC_ARRAY" + POSTFIX;
    static {
        String regex = START + "AllocateArray\\b" + MID + END;
        macroNodes(ALLOC_ARRAY,  regex);
    }

    public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "ALLOC_ARRAY_OF" + POSTFIX;
    static {
        // Assuming we are looking for an array of "some/package/MyClass". The printout is
        // [Lsome/package/MyClass;
        // or, with more dimensions
        // [[[Lsome/package/MyClass;

        // Case where the searched string is a not fully qualified name (but maybe partially qualified):
        // package/MyClass or MyClass
        // The ".*\\b" will eat the "some/" and "some/package/" resp.
        String partial_name_prefix = ".+\\b";

        // The thing after "allocationKlass:" (the name of the allocated class) is a sequence of:
        // - a non-empty sequence of "["
        // - a single character ("L"),
        // - maybe a non-empty sequence of characters ending on a word boundary
        //   this sequence is omitted if the given name is already fully qualified (exact match)
        //   but will eat the package path prefix in the cases described above
        // - the name we are looking for
        // - the final ";".
        String name_part = "\\[+.(" + partial_name_prefix + ")?" + IS_REPLACED + ";";
        String regex = START + "AllocateArray\\b" + MID + "allocationKlass:" + name_part + ".*" + END;
        macroNodes(ALLOC_ARRAY_OF, regex);
    }

    public static final String OR = PREFIX + "OR" + POSTFIX;
    static {
        beforeMatchingNameRegex(OR, "Or(I|L)");
    }

    public static final String AND = PREFIX + "AND" + POSTFIX;
    static {
        beforeMatchingNameRegex(AND, "And(I|L)");
    }

    public static final String AND_I = PREFIX + "AND_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(AND_I, "AndI");
    }

    public static final String AND_L = PREFIX + "AND_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(AND_L, "AndL");
    }

    public static final String AND_VB = VECTOR_PREFIX + "AND_VB" + POSTFIX;
    static {
        vectorNode(AND_VB, "AndV", TYPE_BYTE);
    }

    public static final String AND_VC = VECTOR_PREFIX + "AND_VC" + POSTFIX;
    static {
        vectorNode(AND_VC, "AndV", TYPE_CHAR);
    }

    public static final String AND_VS = VECTOR_PREFIX + "AND_VS" + POSTFIX;
    static {
        vectorNode(AND_VS, "AndV", TYPE_SHORT);
    }

    public static final String AND_VI = VECTOR_PREFIX + "AND_VI" + POSTFIX;
    static {
        vectorNode(AND_VI, "AndV", TYPE_INT);
    }

    public static final String AND_VL = VECTOR_PREFIX + "AND_VL" + POSTFIX;
    static {
        vectorNode(AND_VL, "AndV", TYPE_LONG);
    }

    public static final String AND_V_MASK = PREFIX + "AND_V_MASK" + POSTFIX;
    static {
        beforeMatchingNameRegex(AND_V_MASK, "AndVMask");
    }

    public static final String AND_REDUCTION_V = PREFIX + "AND_REDUCTION_V" + POSTFIX;
    static {
        superWordNodes(AND_REDUCTION_V, "AndReductionV");
    }

    public static final String CALL = PREFIX + "CALL" + POSTFIX;
    static {
        beforeMatchingNameRegex(CALL, "Call.*Java");
    }

    public static final String CALL_OF = COMPOSITE_PREFIX + "CALL_OF" + POSTFIX;
    static {
        callOfNodes(CALL_OF, "Call.*");
    }

    public static final String CALL_OF_METHOD = COMPOSITE_PREFIX + "CALL_OF_METHOD" + POSTFIX;
    static {
        callOfNodes(CALL_OF_METHOD, "Call.*Java");
    }

    public static final String STATIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "STATIC_CALL_OF_METHOD" + POSTFIX;
    static {
        callOfNodes(STATIC_CALL_OF_METHOD, "CallStaticJava");
    }

    public static final String CAST_II = PREFIX + "CAST_II" + POSTFIX;
    static {
        beforeMatchingNameRegex(CAST_II, "CastII");
    }

    public static final String CAST_LL = PREFIX + "CAST_LL" + POSTFIX;
    static {
        beforeMatchingNameRegex(CAST_LL, "CastLL");
    }

    public static final String CBNZW_HI = PREFIX + "CBNZW_HI" + POSTFIX;
    static {
        optoOnly(CBNZW_HI, "cbwhi");
    }

    public static final String CBZW_LS = PREFIX + "CBZW_LS" + POSTFIX;
    static {
        optoOnly(CBZW_LS, "cbwls");
    }

    public static final String CBZ_LS = PREFIX + "CBZ_LS" + POSTFIX;
    static {
        optoOnly(CBZ_LS, "cbls");
    }

    public static final String CBZ_HI = PREFIX + "CBZ_HI" + POSTFIX;
    static {
        optoOnly(CBZ_HI, "cbhi");
    }

    public static final String CHECKCAST_ARRAY = PREFIX + "CHECKCAST_ARRAY" + POSTFIX;
    static {
        String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*:|.*(?i:mov|mv|or).*precise \\[.*:.*\\R.*(cmp|CMP|CLR))" + END;
        optoOnly(CHECKCAST_ARRAY, regex);
    }

    public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "CHECKCAST_ARRAY_OF" + POSTFIX;
    static {
        String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*" + IS_REPLACED + ":|.*(?i:mov|mv|or).*precise \\[.*" + IS_REPLACED + ":.*\\R.*(cmp|CMP|CLR))" + END;
        optoOnly(CHECKCAST_ARRAY_OF, regex);
    }

    // Does not work on s390 (a rule containing this regex will be skipped on s390).
    public static final String CHECKCAST_ARRAYCOPY = PREFIX + "CHECKCAST_ARRAYCOPY" + POSTFIX;
    static {
        String regex = "(.*((?i:call_leaf_nofp,runtime)|CALL,\\s?runtime leaf nofp|BCTRL.*.leaf call).*checkcast_arraycopy.*" + END;
        optoOnly(CHECKCAST_ARRAYCOPY, regex);
    }

    public static final String CLASS_CHECK_TRAP = PREFIX + "CLASS_CHECK_TRAP" + POSTFIX;
    static {
        trapNodes(CLASS_CHECK_TRAP, "class_check");
    }

    public static final String CMOVE_I = PREFIX + "CMOVE_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMOVE_I, "CMoveI");
    }

    public static final String CMP_I = PREFIX + "CMP_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMP_I, "CmpI");
    }

    public static final String CMP_L = PREFIX + "CMP_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMP_L, "CmpL");
    }

    public static final String CMP_U = PREFIX + "CMP_U" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMP_U, "CmpU\\b");
    }

    public static final String CMP_U3 = PREFIX + "CMP_U3" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMP_U3, "CmpU3");
    }

    public static final String CMP_UL = PREFIX + "CMP_UL" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMP_UL, "CmpUL");
    }

    public static final String CMP_UL3 = PREFIX + "CMP_UL3" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMP_UL3, "CmpUL3");
    }

    public static final String CMP_P = PREFIX + "CMP_P" + POSTFIX;
    static {
        beforeMatchingNameRegex(CMP_P, "CmpP");
    }

    public static final String COMPRESS_BITS = PREFIX + "COMPRESS_BITS" + POSTFIX;
    static {
        beforeMatchingNameRegex(COMPRESS_BITS, "CompressBits");
    }

    public static final String CONV = PREFIX + "CONV" + POSTFIX;
    static {
        beforeMatchingNameRegex(CONV, "Conv");
    }

    public static final String CONV_F2HF = PREFIX + "CONV_F2HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(CONV_F2HF, "ConvF2HF");
    }

    public static final String CONV_I2L = PREFIX + "CONV_I2L" + POSTFIX;
    static {
        beforeMatchingNameRegex(CONV_I2L, "ConvI2L");
    }

    public static final String CONV_L2I = PREFIX + "CONV_L2I" + POSTFIX;
    static {
        beforeMatchingNameRegex(CONV_L2I, "ConvL2I");
    }

    public static final String CONV_HF2F = PREFIX + "CONV_HF2F" + POSTFIX;
    static {
        beforeMatchingNameRegex(CONV_HF2F, "ConvHF2F");
    }

    public static final String CON_I = PREFIX + "CON_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(CON_I, "ConI");
    }

    public static final String CON_L = PREFIX + "CON_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(CON_L, "ConL");
    }

    public static final String CON_D = PREFIX + "CON_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(CON_D, "ConD");
    }

    public static final String CON_F = PREFIX + "CON_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(CON_F, "ConF");
    }

    public static final String COUNTED_LOOP = PREFIX + "COUNTED_LOOP" + POSTFIX;
    static {
        String regex = START + "CountedLoop\\b" + MID + END;
        fromAfterCountedLoops(COUNTED_LOOP, regex);
    }

    public static final String COUNTED_LOOP_MAIN = PREFIX + "COUNTED_LOOP_MAIN" + POSTFIX;
    static {
        String regex = START + "CountedLoop\\b" + MID + "main" + END;
        fromAfterCountedLoops(COUNTED_LOOP_MAIN, regex);
    }

    public static final String DIV = PREFIX + "DIV" + POSTFIX;
    static {
        beforeMatchingNameRegex(DIV, "Div(I|L|F|D)");
    }

    public static final String UDIV = PREFIX + "UDIV" + POSTFIX;
    static {
        beforeMatchingNameRegex(UDIV, "UDiv(I|L|F|D)");
    }

    public static final String DIV_BY_ZERO_TRAP = PREFIX + "DIV_BY_ZERO_TRAP" + POSTFIX;
    static {
        trapNodes(DIV_BY_ZERO_TRAP, "div0_check");
    }

    public static final String DIV_I = PREFIX + "DIV_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(DIV_I, "DivI");
    }

    public static final String DIV_L = PREFIX + "DIV_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(DIV_L, "DivL");
    }

    public static final String DIV_MOD_I = PREFIX + "DIV_MOD_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(DIV_MOD_I, "DivModI");
    }

    public static final String DIV_MOD_L = PREFIX + "DIV_MOD_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(DIV_MOD_L, "DivModL");
    }

    public static final String DIV_VHF = VECTOR_PREFIX + "DIV_VHF" + POSTFIX;
    static {
        vectorNode(DIV_VHF, "DivVHF", TYPE_SHORT);
    }

    public static final String DIV_VF = VECTOR_PREFIX + "DIV_VF" + POSTFIX;
    static {
        vectorNode(DIV_VF, "DivVF", TYPE_FLOAT);
    }

    public static final String DIV_VD = VECTOR_PREFIX + "DIV_VD" + POSTFIX;
    static {
        vectorNode(DIV_VD, "DivVD", TYPE_DOUBLE);
    }

    public static final String DYNAMIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "DYNAMIC_CALL_OF_METHOD" + POSTFIX;
    static {
        callOfNodes(DYNAMIC_CALL_OF_METHOD, "CallDynamicJava");
    }

    public static final String EXPAND_BITS = PREFIX + "EXPAND_BITS" + POSTFIX;
    static {
        beforeMatchingNameRegex(EXPAND_BITS, "ExpandBits");
    }

    public static final String FAST_LOCK = PREFIX + "FAST_LOCK" + POSTFIX;
    static {
        beforeMatchingNameRegex(FAST_LOCK, "FastLock");
    }

    public static final String FAST_UNLOCK = PREFIX + "FAST_UNLOCK" + POSTFIX;
    static {
        String regex = START + "FastUnlock" + MID + END;
        fromMacroToBeforeMatching(FAST_UNLOCK, regex);
    }

    public static final String FIELD_ACCESS = PREFIX + "FIELD_ACCESS" + POSTFIX;
    static {
        String regex = "(.*Field: *" + END;
        optoOnly(FIELD_ACCESS, regex);
    }

    public static final String FMA_VHF = VECTOR_PREFIX + "FMA_VHF" + POSTFIX;
    static {
        vectorNode(FMA_VHF, "FmaVHF", TYPE_SHORT);
    }

    public static final String FMA_VF = VECTOR_PREFIX + "FMA_VF" + POSTFIX;
    static {
        vectorNode(FMA_VF, "FmaVF", TYPE_FLOAT);
    }

    public static final String FMA_VD = VECTOR_PREFIX + "FMA_VD" + POSTFIX;
    static {
        vectorNode(FMA_VD, "FmaVD", TYPE_DOUBLE);
    }

    public static final String FMA_HF = PREFIX + "FMA_HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(FMA_HF, "FmaHF");
    }

    public static final String G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1CompareAndExchangeN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1CompareAndExchangeP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1CompareAndSwapN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1CompareAndSwapP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_ENCODE_P_AND_STORE_N = PREFIX + "G1_ENCODE_P_AND_STORE_N" + POSTFIX;
    static {
        machOnlyNameRegex(G1_ENCODE_P_AND_STORE_N, "g1EncodePAndStoreN");
    }

    public static final String G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1EncodePAndStoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_GET_AND_SET_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_N_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1GetAndSetN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_GET_AND_SET_N_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_GET_AND_SET_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1GetAndSetP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_GET_AND_SET_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_LOAD_N = PREFIX + "G1_LOAD_N" + POSTFIX;
    static {
        machOnlyNameRegex(G1_LOAD_N, "g1LoadN");
    }

    public static final String G1_LOAD_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_N_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1LoadN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_LOAD_N_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1LoadP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_LOAD_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_STORE_N = PREFIX + "G1_STORE_N" + POSTFIX;
    static {
        machOnlyNameRegex(G1_STORE_N, "g1StoreN");
    }

    public static final String G1_STORE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_N_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1StoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_STORE_N_WITH_BARRIER_FLAG, regex);
    }

    public static final String G1_STORE_P = PREFIX + "G1_STORE_P" + POSTFIX;
    static {
        machOnlyNameRegex(G1_STORE_P, "g1StoreP");
    }

    public static final String G1_STORE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "g1StoreP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(G1_STORE_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String IF = PREFIX + "IF" + POSTFIX;
    static {
        beforeMatchingNameRegex(IF, "If\\b");
    }

    // Does not work for VM builds without JVMCI like x86_32 (a rule containing this regex will be skipped without having JVMCI built).
    public static final String INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP = PREFIX + "INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP" + POSTFIX;
    static {
        trapNodes(INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP, "intrinsic_or_type_checked_inlining");
    }

    public static final String INTRINSIC_TRAP = PREFIX + "INTRINSIC_TRAP" + POSTFIX;
    static {
        trapNodes(INTRINSIC_TRAP, "intrinsic");
    }

    // Is only supported on riscv64.
    public static final String IS_FINITE_D = PREFIX + "IS_FINITE_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(IS_FINITE_D, "IsFiniteD");
    }

    // Is only supported on riscv64.
    public static final String IS_FINITE_F = PREFIX + "IS_FINITE_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(IS_FINITE_F, "IsFiniteF");
    }

    public static final String IS_INFINITE_D = PREFIX + "IS_INFINITE_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(IS_INFINITE_D, "IsInfiniteD");
    }

    public static final String IS_INFINITE_F = PREFIX + "IS_INFINITE_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(IS_INFINITE_F, "IsInfiniteF");
    }

    public static final String LOAD = PREFIX + "LOAD" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD, "Load(B|UB|S|US|I|L|F|D|P|N)");
    }

    public static final String LOAD_OF_CLASS = COMPOSITE_PREFIX + "LOAD_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_OF_CLASS, "Load(B|UB|S|US|I|L|F|D|P|N)");
    }

    public static final String LOAD_B = PREFIX + "LOAD_B" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_B, "LoadB");
    }

    public static final String LOAD_B_OF_CLASS = COMPOSITE_PREFIX + "LOAD_B_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_B_OF_CLASS, "LoadB");
    }

    public static final String LOAD_D = PREFIX + "LOAD_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_D, "LoadD");
    }

    public static final String LOAD_D_OF_CLASS = COMPOSITE_PREFIX + "LOAD_D_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_D_OF_CLASS, "LoadD");
    }

    public static final String LOAD_F = PREFIX + "LOAD_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_F, "LoadF");
    }

    public static final String LOAD_F_OF_CLASS = COMPOSITE_PREFIX + "LOAD_F_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_F_OF_CLASS, "LoadF");
    }

    public static final String LOAD_I = PREFIX + "LOAD_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_I, "LoadI");
    }

    public static final String LOAD_I_OF_CLASS = COMPOSITE_PREFIX + "LOAD_I_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_I_OF_CLASS, "LoadI");
    }

    public static final String LOAD_KLASS = PREFIX + "LOAD_KLASS" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_KLASS, "LoadKlass");
    }

    public static final String LOAD_NKLASS = PREFIX + "LOAD_NKLASS" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_NKLASS, "LoadNKlass");
    }

    public static final String LOAD_KLASS_OR_NKLASS = PREFIX + "LOAD_KLASS_OR_NKLASS" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_KLASS_OR_NKLASS, "LoadN?Klass");
    }

    public static final String LOAD_L = PREFIX + "LOAD_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_L, "LoadL");
    }

    public static final String LOAD_L_OF_CLASS = COMPOSITE_PREFIX + "LOAD_L_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_L_OF_CLASS, "LoadL");
    }

    public static final String LOAD_N = PREFIX + "LOAD_N" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_N, "LoadN");
    }

    public static final String LOAD_N_OF_CLASS = COMPOSITE_PREFIX + "LOAD_N_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_N_OF_CLASS, "LoadN");
    }

    public static final String LOAD_OF_FIELD = COMPOSITE_PREFIX + "LOAD_OF_FIELD" + POSTFIX;
    static {
        String regex = START + "Load(B|C|S|I|L|F|D|P|N)" + MID + "@.*name=" + IS_REPLACED + ",.*" + END;
        beforeMatching(LOAD_OF_FIELD, regex);
    }

    public static final String LOAD_P = PREFIX + "LOAD_P" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_P, "LoadP");
    }

    public static final String LOAD_P_OF_CLASS = COMPOSITE_PREFIX + "LOAD_P_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_P_OF_CLASS, "LoadP");
    }

    public static final String LOAD_S = PREFIX + "LOAD_S" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_S, "LoadS");
    }

    public static final String LOAD_S_OF_CLASS = COMPOSITE_PREFIX + "LOAD_S_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_S_OF_CLASS, "LoadS");
    }

    public static final String LOAD_UB = PREFIX + "LOAD_UB" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_UB, "LoadUB");
    }

    public static final String LOAD_UB_OF_CLASS = COMPOSITE_PREFIX + "LOAD_UB_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_UB_OF_CLASS, "LoadUB");
    }

    public static final String LOAD_US = PREFIX + "LOAD_US" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_US, "LoadUS");
    }

    public static final String LOAD_US_OF_CLASS = COMPOSITE_PREFIX + "LOAD_US_OF_CLASS" + POSTFIX;
    static {
        loadOfNodes(LOAD_US_OF_CLASS, "LoadUS");
    }

    public static final String LOAD_VECTOR_B = VECTOR_PREFIX + "LOAD_VECTOR_B" + POSTFIX;
    static {
        vectorNode(LOAD_VECTOR_B, "LoadVector", TYPE_BYTE);
    }

    public static final String LOAD_VECTOR_C = VECTOR_PREFIX + "LOAD_VECTOR_C" + POSTFIX;
    static {
        vectorNode(LOAD_VECTOR_C, "LoadVector", TYPE_CHAR);
    }

    public static final String LOAD_VECTOR_S = VECTOR_PREFIX + "LOAD_VECTOR_S" + POSTFIX;
    static {
        vectorNode(LOAD_VECTOR_S, "LoadVector", TYPE_SHORT);
    }

    public static final String LOAD_VECTOR_I = VECTOR_PREFIX + "LOAD_VECTOR_I" + POSTFIX;
    static {
        vectorNode(LOAD_VECTOR_I, "LoadVector", TYPE_INT);
    }

    public static final String LOAD_VECTOR_L = VECTOR_PREFIX + "LOAD_VECTOR_L" + POSTFIX;
    static {
        vectorNode(LOAD_VECTOR_L, "LoadVector", TYPE_LONG);
    }

    public static final String LOAD_VECTOR_F = VECTOR_PREFIX + "LOAD_VECTOR_F" + POSTFIX;
    static {
        vectorNode(LOAD_VECTOR_F, "LoadVector", TYPE_FLOAT);
    }

    public static final String LOAD_VECTOR_D = VECTOR_PREFIX + "LOAD_VECTOR_D" + POSTFIX;
    static {
        vectorNode(LOAD_VECTOR_D, "LoadVector", TYPE_DOUBLE);
    }

    public static final String LOAD_VECTOR_GATHER = PREFIX + "LOAD_VECTOR_GATHER" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_VECTOR_GATHER, "LoadVectorGather");
    }

    public static final String LOAD_VECTOR_MASKED = PREFIX + "LOAD_VECTOR_MASKED" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_VECTOR_MASKED, "LoadVectorMasked");
    }

    public static final String LOAD_VECTOR_GATHER_MASKED = PREFIX + "LOAD_VECTOR_GATHER_MASKED" + POSTFIX;
    static {
        beforeMatchingNameRegex(LOAD_VECTOR_GATHER_MASKED, "LoadVectorGatherMasked");
    }

    public static final String LONG_COUNTED_LOOP = PREFIX + "LONG_COUNTED_LOOP" + POSTFIX;
    static {
        String regex = START + "LongCountedLoop\\b" + MID + END;
        fromAfterCountedLoops(LONG_COUNTED_LOOP, regex);
    }

    public static final String LOOP = PREFIX + "LOOP" + POSTFIX;
    static {
        String regex = START + "Loop" + MID + END;
        fromBeforeCountedLoops(LOOP, regex);
    }

    public static final String LSHIFT = PREFIX + "LSHIFT" + POSTFIX;
    static {
        beforeMatchingNameRegex(LSHIFT, "LShift(I|L)");
    }

    public static final String LSHIFT_I = PREFIX + "LSHIFT_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(LSHIFT_I, "LShiftI");
    }

    public static final String LSHIFT_L = PREFIX + "LSHIFT_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(LSHIFT_L, "LShiftL");
    }

    public static final String LSHIFT_VB = VECTOR_PREFIX + "LSHIFT_VB" + POSTFIX;
    static {
        vectorNode(LSHIFT_VB, "LShiftVB", TYPE_BYTE);
    }

    public static final String LSHIFT_VS = VECTOR_PREFIX + "LSHIFT_VS" + POSTFIX;
    static {
        vectorNode(LSHIFT_VS, "LShiftVS", TYPE_SHORT);
    }

    public static final String LSHIFT_VC = VECTOR_PREFIX + "LSHIFT_VC" + POSTFIX;
    static {
        vectorNode(LSHIFT_VC, "LShiftVS", TYPE_CHAR); // using short op with char type
    }

    public static final String LSHIFT_VI = VECTOR_PREFIX + "LSHIFT_VI" + POSTFIX;
    static {
        vectorNode(LSHIFT_VI, "LShiftVI", TYPE_INT);
    }

    public static final String LSHIFT_VL = VECTOR_PREFIX + "LSHIFT_VL" + POSTFIX;
    static {
        vectorNode(LSHIFT_VL, "LShiftVL", TYPE_LONG);
    }

    public static final String MACH_TEMP = PREFIX + "MACH_TEMP" + POSTFIX;
    static {
        machOnlyNameRegex(MACH_TEMP, "MachTemp");
    }

    public static final String MACRO_LOGIC_V = PREFIX + "MACRO_LOGIC_V" + POSTFIX;
    static {
        afterBarrierExpansionToBeforeMatching(MACRO_LOGIC_V, "MacroLogicV");
    }

    public static final String MAX = PREFIX + "MAX" + POSTFIX;
    static {
        beforeMatchingNameRegex(MAX, "Max(I|L|F|D)");
    }

    public static final String MAX_D = PREFIX + "MAX_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(MAX_D, "MaxD");
    }

    public static final String MAX_D_REDUCTION_REG = PREFIX + "MAX_D_REDUCTION_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MAX_D_REDUCTION_REG, "maxD_reduction_reg");
    }

    public static final String MAX_D_REG = PREFIX + "MAX_D_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MAX_D_REG, "maxD_reg");
    }

    public static final String MAX_F = PREFIX + "MAX_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(MAX_F, "MaxF");
    }

    public static final String MAX_F_REDUCTION_REG = PREFIX + "MAX_F_REDUCTION_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MAX_F_REDUCTION_REG, "maxF_reduction_reg");
    }

    public static final String MAX_F_REG = PREFIX + "MAX_F_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MAX_F_REG, "maxF_reg");
    }

    public static final String MAX_I = PREFIX + "MAX_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(MAX_I, "MaxI");
    }

    public static final String MAX_L = PREFIX + "MAX_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(MAX_L, "MaxL");
    }

    public static final String MAX_VI = VECTOR_PREFIX + "MAX_VI" + POSTFIX;
    static {
        vectorNode(MAX_VI, "MaxV", TYPE_INT);
    }

    public static final String MAX_VHF = VECTOR_PREFIX + "MAX_VHF" + POSTFIX;
    static {
        vectorNode(MAX_VHF, "MaxVHF", TYPE_SHORT);
    }

    public static final String MAX_VF = VECTOR_PREFIX + "MAX_VF" + POSTFIX;
    static {
        vectorNode(MAX_VF, "MaxV", TYPE_FLOAT);
    }

    public static final String MAX_VD = VECTOR_PREFIX + "MAX_VD" + POSTFIX;
    static {
        vectorNode(MAX_VD, "MaxV", TYPE_DOUBLE);
    }

    public static final String MAX_VL = VECTOR_PREFIX + "MAX_VL" + POSTFIX;
    static {
        vectorNode(MAX_VL, "MaxV", TYPE_LONG);
    }

    public static final String MEMBAR = PREFIX + "MEMBAR" + POSTFIX;
    static {
        beforeMatchingNameRegex(MEMBAR, "MemBar");
    }

    public static final String MEMBAR_ACQUIRE = PREFIX + "MEMBAR_ACQUIRE" + POSTFIX;
    static {
        beforeMatchingNameRegex(MEMBAR_ACQUIRE, "MemBarAcquire");
    }

    public static final String MEMBAR_RELEASE = PREFIX + "MEMBAR_RELEASE" + POSTFIX;
    static {
        beforeMatchingNameRegex(MEMBAR_RELEASE, "MemBarRelease");
    }

    public static final String MEMBAR_STORESTORE = PREFIX + "MEMBAR_STORESTORE" + POSTFIX;
    static {
        beforeMatchingNameRegex(MEMBAR_STORESTORE, "MemBarStoreStore");
    }

    public static final String MEMBAR_VOLATILE = PREFIX + "MEMBAR_VOLATILE" + POSTFIX;
    static {
        beforeMatchingNameRegex(MEMBAR_VOLATILE, "MemBarVolatile");
    }

    public static final String MIN = PREFIX + "MIN" + POSTFIX;
    static {
        beforeMatchingNameRegex(MIN, "Min(I|L)");
    }

    public static final String MIN_D = PREFIX + "MIN_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(MIN_D, "MinD");
    }

    public static final String MIN_D_REDUCTION_REG = PREFIX + "MIN_D_REDUCTION_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MIN_D_REDUCTION_REG, "minD_reduction_reg");
    }

    public static final String MIN_D_REG = PREFIX + "MIN_D_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MIN_D_REG, "minD_reg");
    }

    public static final String MIN_F = PREFIX + "MIN_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(MIN_F, "MinF");
    }

    public static final String MIN_F_REDUCTION_REG = PREFIX + "MIN_F_REDUCTION_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MIN_F_REDUCTION_REG, "minF_reduction_reg");
    }

    public static final String MIN_F_REG = PREFIX + "MIN_F_REG" + POSTFIX;
    static {
        machOnlyNameRegex(MIN_F_REG, "minF_reg");
    }

    public static final String MIN_I = PREFIX + "MIN_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(MIN_I, "MinI");
    }

    public static final String MIN_L = PREFIX + "MIN_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(MIN_L, "MinL");
    }

    public static final String MIN_HF = PREFIX + "MIN_HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(MIN_HF, "MinHF");
    }

    public static final String MAX_HF = PREFIX + "MAX_HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(MAX_HF, "MaxHF");
    }

    public static final String MIN_VI = VECTOR_PREFIX + "MIN_VI" + POSTFIX;
    static {
        vectorNode(MIN_VI, "MinV", TYPE_INT);
    }

    public static final String MIN_VHF = VECTOR_PREFIX + "MIN_VHF" + POSTFIX;
    static {
        vectorNode(MIN_VHF, "MinVHF", TYPE_SHORT);
    }

    public static final String MIN_VF = VECTOR_PREFIX + "MIN_VF" + POSTFIX;
    static {
        vectorNode(MIN_VF, "MinV", TYPE_FLOAT);
    }

    public static final String MIN_VD = VECTOR_PREFIX + "MIN_VD" + POSTFIX;
    static {
        vectorNode(MIN_VD, "MinV", TYPE_DOUBLE);
    }

    public static final String MIN_VL = VECTOR_PREFIX + "MIN_VL" + POSTFIX;
    static {
        vectorNode(MIN_VL, "MinV", TYPE_LONG);
    }

    public static final String MOD_I = PREFIX + "MOD_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(MOD_I, "ModI");
    }

    public static final String MOD_L = PREFIX + "MOD_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(MOD_L, "ModL");
    }

    public static final String MOV_F2I = PREFIX + "MOV_F2I" + POSTFIX;
    static {
        beforeMatchingNameRegex(MOV_F2I, "MoveF2I");
    }

    public static final String MOV_I2F = PREFIX + "MOV_I2F" + POSTFIX;
    static {
        beforeMatchingNameRegex(MOV_I2F, "MoveI2F");
    }

    public static final String MOV_D2L = PREFIX + "MOV_D2L" + POSTFIX;
    static {
        beforeMatchingNameRegex(MOV_D2L, "MoveD2L");
    }

    public static final String MOV_L2D = PREFIX + "MOD_L2D" + POSTFIX;
    static {
        beforeMatchingNameRegex(MOV_L2D, "MoveL2D");
    }

    public static final String MUL = PREFIX + "MUL" + POSTFIX;
    static {
        beforeMatchingNameRegex(MUL, "Mul(I|L|F|D)");
    }

    public static final String MUL_ADD_S2I = PREFIX + "MUL_ADD_S2I" + POSTFIX;
    static {
        beforeMatchingNameRegex(MUL_ADD_S2I, "MulAddS2I");
    }

    public static final String MUL_ADD_VS2VI = VECTOR_PREFIX + "MUL_ADD_VS2VI" + POSTFIX;
    static {
        vectorNode(MUL_ADD_VS2VI, "MulAddVS2VI", TYPE_INT);
    }

    public static final String UMIN_VB = VECTOR_PREFIX + "UMIN_VB" + POSTFIX;
    static {
        vectorNode(UMIN_VB, "UMinV", TYPE_BYTE);
    }

    public static final String UMIN_VS = VECTOR_PREFIX + "UMIN_VS" + POSTFIX;
    static {
        vectorNode(UMIN_VS, "UMinV", TYPE_SHORT);
    }

    public static final String UMIN_VI = VECTOR_PREFIX + "UMIN_VI" + POSTFIX;
    static {
        vectorNode(UMIN_VI, "UMinV", TYPE_INT);
    }

    public static final String UMIN_VL = VECTOR_PREFIX + "UMIN_VL" + POSTFIX;
    static {
        vectorNode(UMIN_VL, "UMinV", TYPE_LONG);
    }

    public static final String UMAX_VB = VECTOR_PREFIX + "UMAX_VB" + POSTFIX;
    static {
        vectorNode(UMAX_VB, "UMaxV", TYPE_BYTE);
    }

    public static final String UMAX_VS = VECTOR_PREFIX + "UMAX_VS" + POSTFIX;
    static {
        vectorNode(UMAX_VS, "UMaxV", TYPE_SHORT);
    }

    public static final String UMAX_VI = VECTOR_PREFIX + "UMAX_VI" + POSTFIX;
    static {
        vectorNode(UMAX_VI, "UMaxV", TYPE_INT);
    }

    public static final String UMAX_VL = VECTOR_PREFIX + "UMAX_VL" + POSTFIX;
    static {
        vectorNode(UMAX_VL, "UMaxV", TYPE_LONG);
    }

    // Can only be used if avx512_vnni is available.
    public static final String MUL_ADD_VS2VI_VNNI = PREFIX + "MUL_ADD_VS2VI_VNNI" + POSTFIX;
    static {
        machOnly(MUL_ADD_VS2VI_VNNI, "vmuladdaddS2I_reg");
    }

    public static final String MUL_D = PREFIX + "MUL_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(MUL_D, "MulD");
    }

    public static final String MUL_F = PREFIX + "MUL_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(MUL_F, "MulF");
    }

    public static final String MUL_HF = PREFIX + "MUL_HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(MUL_HF, "MulHF");
    }

    public static final String MUL_I = PREFIX + "MUL_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(MUL_I, "MulI");
    }

    public static final String MUL_L = PREFIX + "MUL_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(MUL_L, "MulL");
    }

    public static final String MUL_VL = VECTOR_PREFIX + "MUL_VL" + POSTFIX;
    static {
        vectorNode(MUL_VL, "MulVL", TYPE_LONG);
    }

    public static final String MUL_VI = VECTOR_PREFIX + "MUL_VI" + POSTFIX;
    static {
        vectorNode(MUL_VI, "MulVI", TYPE_INT);
    }

    public static final String MUL_VHF = VECTOR_PREFIX + "MUL_VHF" + POSTFIX;
    static {
        vectorNode(MUL_VHF, "MulVHF", TYPE_SHORT);
    }

    public static final String MUL_VF = VECTOR_PREFIX + "MUL_VF" + POSTFIX;
    static {
        vectorNode(MUL_VF, "MulVF", TYPE_FLOAT);
    }

    public static final String MUL_VD = VECTOR_PREFIX + "MUL_VD" + POSTFIX;
    static {
        vectorNode(MUL_VD, "MulVD", TYPE_DOUBLE);
    }

    public static final String MUL_VB = VECTOR_PREFIX + "MUL_VB" + POSTFIX;
    static {
        vectorNode(MUL_VB, "MulVB", TYPE_BYTE);
    }

    public static final String MUL_VS = VECTOR_PREFIX + "MUL_VS" + POSTFIX;
    static {
        vectorNode(MUL_VS, "MulVS", TYPE_SHORT);
    }

    public static final String MUL_REDUCTION_VD = PREFIX + "MUL_REDUCTION_VD" + POSTFIX;
    static {
        superWordNodes(MUL_REDUCTION_VD, "MulReductionVD");
    }

    public static final String MUL_REDUCTION_VF = PREFIX + "MUL_REDUCTION_VF" + POSTFIX;
    static {
        superWordNodes(MUL_REDUCTION_VF, "MulReductionVF");
    }

    public static final String MUL_REDUCTION_VI = PREFIX + "MUL_REDUCTION_VI" + POSTFIX;
    static {
        superWordNodes(MUL_REDUCTION_VI, "MulReductionVI");
    }

    public static final String MUL_REDUCTION_VL = PREFIX + "MUL_REDUCTION_VL" + POSTFIX;
    static {
        superWordNodes(MUL_REDUCTION_VL, "MulReductionVL");
    }

    public static final String MIN_REDUCTION_V = PREFIX + "MIN_REDUCTION_V" + POSTFIX;
    static {
        superWordNodes(MIN_REDUCTION_V, "MinReductionV");
    }

    public static final String MAX_REDUCTION_V = PREFIX + "MAX_REDUCTION_V" + POSTFIX;
    static {
        superWordNodes(MAX_REDUCTION_V, "MaxReductionV");
    }

    public static final String NEG_VF = VECTOR_PREFIX + "NEG_VF" + POSTFIX;
    static {
        vectorNode(NEG_VF, "NegVF", TYPE_FLOAT);
    }

    public static final String NEG_VD = VECTOR_PREFIX + "NEG_VD" + POSTFIX;
    static {
        vectorNode(NEG_VD, "NegVD", TYPE_DOUBLE);
    }

    public static final String NOP = PREFIX + "NOP" + POSTFIX;
    static {
        machOnlyNameRegex(NOP, "Nop");
    }

    public static final String NULL_ASSERT_TRAP = PREFIX + "NULL_ASSERT_TRAP" + POSTFIX;
    static {
        trapNodes(NULL_ASSERT_TRAP, "null_assert");
    }

    public static final String NULL_CHECK_TRAP = PREFIX + "NULL_CHECK_TRAP" + POSTFIX;
    static {
        trapNodes(NULL_CHECK_TRAP, "null_check");
    }

    public static final String OOPMAP_WITH = COMPOSITE_PREFIX + "OOPMAP_WITH" + POSTFIX;
    static {
        String regex = "(#\\s*OopMap\\s*\\{.*" + IS_REPLACED + ".*\\})";
        optoOnly(OOPMAP_WITH, regex);
    }

    public static final String OPAQUE_TEMPLATE_ASSERTION_PREDICATE = PREFIX + "OPAQUE_TEMPLATE_ASSERTION_PREDICATE" + POSTFIX;
    static {
        duringLoopOpts(OPAQUE_TEMPLATE_ASSERTION_PREDICATE, "OpaqueTemplateAssertionPredicate");
    }

    public static final String OR_I = PREFIX + "OR_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(OR_I, "OrI");
    }

    public static final String OR_L = PREFIX + "OR_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(OR_L, "OrL");
    }

    public static final String OR_VB = VECTOR_PREFIX + "OR_VB" + POSTFIX;
    static {
        vectorNode(OR_VB, "OrV", TYPE_BYTE);
    }

    public static final String OR_VS = VECTOR_PREFIX + "OR_VS" + POSTFIX;
    static {
        vectorNode(OR_VS, "OrV", TYPE_SHORT);
    }

    public static final String OR_VI = VECTOR_PREFIX + "OR_VI" + POSTFIX;
    static {
        vectorNode(OR_VI, "OrV", TYPE_INT);
    }

    public static final String OR_VL = VECTOR_PREFIX + "OR_VL" + POSTFIX;
    static {
        vectorNode(OR_VL, "OrV", TYPE_LONG);
    }

    public static final String OR_V_MASK = PREFIX + "OR_V_MASK" + POSTFIX;
    static {
        beforeMatchingNameRegex(OR_V_MASK, "OrVMask");
    }

    public static final String OR_REDUCTION_V = PREFIX + "OR_REDUCTION_V" + POSTFIX;
    static {
        superWordNodes(OR_REDUCTION_V, "OrReductionV");
    }

    public static final String OUTER_STRIP_MINED_LOOP = PREFIX + "OUTER_STRIP_MINED_LOOP" + POSTFIX;
    static {
        String regex = START + "OuterStripMinedLoop\\b" + MID + END;
        fromAfterCountedLoops(OUTER_STRIP_MINED_LOOP, regex);
    }

    public static final String PARTIAL_SUBTYPE_CHECK = PREFIX + "PARTIAL_SUBTYPE_CHECK" + POSTFIX;
    static {
        beforeMatchingNameRegex(PARTIAL_SUBTYPE_CHECK, "PartialSubtypeCheck");
    }

    public static final String PHI = PREFIX + "PHI" + POSTFIX;
    static {
        beforeMatchingNameRegex(PHI, "Phi");
    }

    public static final String POPCOUNT_L = PREFIX + "POPCOUNT_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(POPCOUNT_L, "PopCountL");
    }

    public static final String POPCOUNT_VI = VECTOR_PREFIX + "POPCOUNT_VI" + POSTFIX;
    static {
        vectorNode(POPCOUNT_VI, "PopCountVI", TYPE_INT);
    }

    public static final String POPCOUNT_VL = VECTOR_PREFIX + "POPCOUNT_VL" + POSTFIX;
    static {
        vectorNode(POPCOUNT_VL, "PopCountVL", TYPE_LONG);
    }

    public static final String COUNT_TRAILING_ZEROS_VL = VECTOR_PREFIX + "COUNT_TRAILING_ZEROS_VL" + POSTFIX;
    static {
        vectorNode(COUNT_TRAILING_ZEROS_VL, "CountTrailingZerosV", TYPE_LONG);
    }

    public static final String COUNT_TRAILING_ZEROS_VI = VECTOR_PREFIX + "COUNT_TRAILING_ZEROS_VI" + POSTFIX;
    static {
        vectorNode(COUNT_TRAILING_ZEROS_VI, "CountTrailingZerosV", TYPE_INT);
    }

    public static final String COUNT_LEADING_ZEROS_VL = VECTOR_PREFIX + "COUNT_LEADING_ZEROS_VL" + POSTFIX;
    static {
        vectorNode(COUNT_LEADING_ZEROS_VL, "CountLeadingZerosV", TYPE_LONG);
    }

    public static final String COUNT_LEADING_ZEROS_VI = VECTOR_PREFIX + "COUNT_LEADING_ZEROS_VI" + POSTFIX;
    static {
        vectorNode(COUNT_LEADING_ZEROS_VI, "CountLeadingZerosV", TYPE_INT);
    }

    public static final String POPULATE_INDEX = PREFIX + "POPULATE_INDEX" + POSTFIX;
    static {
        String regex = START + "PopulateIndex" + MID + END;
        IR_NODE_MAPPINGS.put(POPULATE_INDEX, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
                                                                       CompilePhase.AFTER_CLOOPS,
                                                                       CompilePhase.BEFORE_MATCHING));
    }

    public static final String LOOP_PARSE_PREDICATE = PREFIX + "LOOP_PARSE_PREDICATE" + POSTFIX;
    static {
        parsePredicateNodes(LOOP_PARSE_PREDICATE, "Loop");
    }

    public static final String LOOP_LIMIT_CHECK_PARSE_PREDICATE = PREFIX + "LOOP_LIMIT_CHECK_PARSE_PREDICATE" + POSTFIX;
    static {
        parsePredicateNodes(LOOP_LIMIT_CHECK_PARSE_PREDICATE, "Loop_Limit_Check");
    }

    public static final String PROFILED_LOOP_PARSE_PREDICATE = PREFIX + "PROFILED_LOOP_PARSE_PREDICATE" + POSTFIX;
    static {
        parsePredicateNodes(PROFILED_LOOP_PARSE_PREDICATE, "Profiled_Loop");
    }

    public static final String AUTO_VECTORIZATION_CHECK_PARSE_PREDICATE = PREFIX + "AUTO_VECTORIZATION_CHECK_PARSE_PREDICATE" + POSTFIX;
    static {
        parsePredicateNodes(AUTO_VECTORIZATION_CHECK_PARSE_PREDICATE, "Auto_Vectorization_Check");
    }

    public static final String PREDICATE_TRAP = PREFIX + "PREDICATE_TRAP" + POSTFIX;
    static {
        trapNodes(PREDICATE_TRAP, "predicate");
    }

    public static final String RANGE_CHECK_TRAP = PREFIX + "RANGE_CHECK_TRAP" + POSTFIX;
    static {
        trapNodes(RANGE_CHECK_TRAP, "range_check");
    }

    public static final String REINTERPRET_S2HF = PREFIX + "REINTERPRET_S2HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(REINTERPRET_S2HF, "ReinterpretS2HF");
    }

    public static final String REINTERPRET_HF2S = PREFIX + "REINTERPRET_HF2S" + POSTFIX;
    static {
        beforeMatchingNameRegex(REINTERPRET_HF2S, "ReinterpretHF2S");
    }

    public static final String REPLICATE_B = VECTOR_PREFIX + "REPLICATE_B" + POSTFIX;
    static {
        vectorNode(REPLICATE_B, "Replicate", TYPE_BYTE);
    }

    public static final String REPLICATE_S = VECTOR_PREFIX + "REPLICATE_S" + POSTFIX;
    static {
        vectorNode(REPLICATE_S, "Replicate", TYPE_SHORT);
    }

    public static final String REPLICATE_I = VECTOR_PREFIX + "REPLICATE_I" + POSTFIX;
    static {
        vectorNode(REPLICATE_I, "Replicate", TYPE_INT);
    }

    public static final String REPLICATE_L = VECTOR_PREFIX + "REPLICATE_L" + POSTFIX;
    static {
        vectorNode(REPLICATE_L, "Replicate", TYPE_LONG);
    }

    public static final String REPLICATE_F = VECTOR_PREFIX + "REPLICATE_F" + POSTFIX;
    static {
        vectorNode(REPLICATE_F, "Replicate", TYPE_FLOAT);
    }

    public static final String REPLICATE_D = VECTOR_PREFIX + "REPLICATE_D" + POSTFIX;
    static {
        vectorNode(REPLICATE_D, "Replicate", TYPE_DOUBLE);
    }

    public static final String REVERSE_BYTES_I = PREFIX + "REVERSE_BYTES_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(REVERSE_BYTES_I, "ReverseBytesI");
    }

    public static final String REVERSE_BYTES_L = PREFIX + "REVERSE_BYTES_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(REVERSE_BYTES_L, "ReverseBytesL");
    }

    public static final String REVERSE_BYTES_S = PREFIX + "REVERSE_BYTES_S" + POSTFIX;
    static {
        beforeMatchingNameRegex(REVERSE_BYTES_S, "ReverseBytesS");
    }

    public static final String REVERSE_BYTES_US = PREFIX + "REVERSE_BYTES_US" + POSTFIX;
    static {
        beforeMatchingNameRegex(REVERSE_BYTES_US, "ReverseBytesUS");
    }

    public static final String REVERSE_BYTES_VB = VECTOR_PREFIX + "REVERSE_BYTES_VB" + POSTFIX;
    static {
        vectorNode(REVERSE_BYTES_VB, "ReverseBytesV", TYPE_BYTE);
    }

    public static final String REVERSE_BYTES_VS = VECTOR_PREFIX + "REVERSE_BYTES_VS" + POSTFIX;
    static {
        vectorNode(REVERSE_BYTES_VS, "ReverseBytesV", TYPE_SHORT);
    }

    public static final String REVERSE_BYTES_VI = VECTOR_PREFIX + "REVERSE_BYTES_VI" + POSTFIX;
    static {
        vectorNode(REVERSE_BYTES_VI, "ReverseBytesV", TYPE_INT);
    }

    public static final String REVERSE_BYTES_VL = VECTOR_PREFIX + "REVERSE_BYTES_VL" + POSTFIX;
    static {
        vectorNode(REVERSE_BYTES_VL, "ReverseBytesV", TYPE_LONG);
    }

    public static final String REVERSE_I = PREFIX + "REVERSE_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(REVERSE_I, "ReverseI");
    }

    public static final String REVERSE_L = PREFIX + "REVERSE_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(REVERSE_L, "ReverseL");
    }

    public static final String REVERSE_VI = VECTOR_PREFIX + "REVERSE_VI" + POSTFIX;
    static {
        vectorNode(REVERSE_VI, "ReverseV", TYPE_INT);
    }

    public static final String REVERSE_VL = VECTOR_PREFIX + "REVERSE_VL" + POSTFIX;
    static {
        vectorNode(REVERSE_VL, "ReverseV", TYPE_LONG);
    }

    public static final String ROUND_VD = VECTOR_PREFIX + "ROUND_VD" + POSTFIX;
    static {
        vectorNode(ROUND_VD, "RoundVD", TYPE_LONG);
    }

    public static final String ROUND_VF = VECTOR_PREFIX + "ROUND_VF" + POSTFIX;
    static {
        vectorNode(ROUND_VF, "RoundVF", TYPE_INT);
    }

    public static final String ROTATE_LEFT = PREFIX + "ROTATE_LEFT" + POSTFIX;
    static {
        beforeMatchingNameRegex(ROTATE_LEFT, "RotateLeft");
    }

    public static final String ROTATE_RIGHT = PREFIX + "ROTATE_RIGHT" + POSTFIX;
    static {
        beforeMatchingNameRegex(ROTATE_RIGHT, "RotateRight");
    }

    public static final String ROTATE_LEFT_V = PREFIX + "ROTATE_LEFT_V" + POSTFIX;
    static {
        beforeMatchingNameRegex(ROTATE_LEFT_V, "RotateLeftV");
    }

    public static final String ROTATE_RIGHT_V = PREFIX + "ROTATE_RIGHT_V" + POSTFIX;
    static {
        beforeMatchingNameRegex(ROTATE_RIGHT_V, "RotateRightV");
    }

    public static final String ROUND_DOUBLE_MODE_V = VECTOR_PREFIX + "ROUND_DOUBLE_MODE_V" + POSTFIX;
    static {
        vectorNode(ROUND_DOUBLE_MODE_V, "RoundDoubleModeV", TYPE_DOUBLE);
    }

    public static final String RSHIFT = PREFIX + "RSHIFT" + POSTFIX;
    static {
        beforeMatchingNameRegex(RSHIFT, "RShift(I|L)");
    }

    public static final String RSHIFT_I = PREFIX + "RSHIFT_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(RSHIFT_I, "RShiftI");
    }

    public static final String RSHIFT_L = PREFIX + "RSHIFT_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(RSHIFT_L, "RShiftL");
    }

    public static final String RSHIFT_VB = VECTOR_PREFIX + "RSHIFT_VB" + POSTFIX;
    static {
        vectorNode(RSHIFT_VB, "RShiftVB", TYPE_BYTE);
    }

    public static final String RSHIFT_VS = VECTOR_PREFIX + "RSHIFT_VS" + POSTFIX;
    static {
        vectorNode(RSHIFT_VS, "RShiftVS", TYPE_SHORT);
    }

    public static final String RSHIFT_VC = VECTOR_PREFIX + "RSHIFT_VC" + POSTFIX;
    static {
        vectorNode(RSHIFT_VC, "RShiftVS", TYPE_CHAR); // short computation with char type
    }

    public static final String RSHIFT_VI = VECTOR_PREFIX + "RSHIFT_VI" + POSTFIX;
    static {
        vectorNode(RSHIFT_VI, "RShiftVI", TYPE_INT);
    }

    public static final String RSHIFT_VL = VECTOR_PREFIX + "RSHIFT_VL" + POSTFIX;
    static {
        vectorNode(RSHIFT_VL, "RShiftVL", TYPE_LONG);
    }

    public static final String SAFEPOINT = PREFIX + "SAFEPOINT" + POSTFIX;
    static {
        beforeMatchingNameRegex(SAFEPOINT, "SafePoint");
    }

    public static final String SCOPE_OBJECT = PREFIX + "SCOPE_OBJECT" + POSTFIX;
    static {
        String regex = "(.*# ScObj.*" + END;
        optoOnly(SCOPE_OBJECT, regex);
    }

    public static final String SIGNUM_VD = VECTOR_PREFIX + "SIGNUM_VD" + POSTFIX;
    static {
        vectorNode(SIGNUM_VD, "SignumVD", TYPE_DOUBLE);
    }

    public static final String SIGNUM_VF = VECTOR_PREFIX + "SIGNUM_VF" + POSTFIX;
    static {
        vectorNode(SIGNUM_VF, "SignumVF", TYPE_FLOAT);
    }

    public static final String SQRT_VHF = VECTOR_PREFIX + "SQRT_VHF" + POSTFIX;
    static {
        vectorNode(SQRT_VHF, "SqrtVHF", TYPE_SHORT);
    }

    public static final String SQRT_HF = PREFIX + "SQRT_HF" + POSTFIX;
    static {
       beforeMatchingNameRegex(SQRT_HF, "SqrtHF");
    }

    public static final String SQRT_F = PREFIX + "SQRT_F" + POSTFIX;
    static {
       beforeMatchingNameRegex(SQRT_F, "SqrtF");
    }

    public static final String SQRT_VF = VECTOR_PREFIX + "SQRT_VF" + POSTFIX;
    static {
        vectorNode(SQRT_VF, "SqrtVF", TYPE_FLOAT);
    }

    public static final String SQRT_VD = VECTOR_PREFIX + "SQRT_VD" + POSTFIX;
    static {
        vectorNode(SQRT_VD, "SqrtVD", TYPE_DOUBLE);
    }

    public static final String STORE = PREFIX + "STORE" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE, "Store(B|C|S|I|L|F|D|P|N)");
    }

    public static final String STORE_B = PREFIX + "STORE_B" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_B, "StoreB");
    }

    public static final String STORE_B_OF_CLASS = COMPOSITE_PREFIX + "STORE_B_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_B_OF_CLASS, "StoreB");
    }

    public static final String STORE_C = PREFIX + "STORE_C" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_C, "StoreC");
    }

    public static final String STORE_C_OF_CLASS = COMPOSITE_PREFIX + "STORE_C_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_C_OF_CLASS, "StoreC");
    }

    public static final String STORE_D = PREFIX + "STORE_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_D, "StoreD");
    }

    public static final String STORE_D_OF_CLASS = COMPOSITE_PREFIX + "STORE_D_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_D_OF_CLASS, "StoreD");
    }

    public static final String STORE_F = PREFIX + "STORE_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_F, "StoreF");
    }

    public static final String STORE_F_OF_CLASS = COMPOSITE_PREFIX + "STORE_F_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_F_OF_CLASS, "StoreF");
    }

    public static final String STORE_I = PREFIX + "STORE_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_I, "StoreI");
    }

    public static final String STORE_I_OF_CLASS = COMPOSITE_PREFIX + "STORE_I_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_I_OF_CLASS, "StoreI");
    }

    public static final String STORE_L = PREFIX + "STORE_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_L, "StoreL");
    }

    public static final String STORE_L_OF_CLASS = COMPOSITE_PREFIX + "STORE_L_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_L_OF_CLASS, "StoreL");
    }

    public static final String STORE_N = PREFIX + "STORE_N" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_N, "StoreN");
    }

    public static final String STORE_N_OF_CLASS = COMPOSITE_PREFIX + "STORE_N_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_N_OF_CLASS, "StoreN");
    }

    public static final String STORE_OF_CLASS = COMPOSITE_PREFIX + "STORE_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_OF_CLASS, "Store(B|C|S|I|L|F|D|P|N)");
    }

    public static final String STORE_OF_FIELD = COMPOSITE_PREFIX + "STORE_OF_FIELD" + POSTFIX;
    static {
        String regex = START + "Store(B|C|S|I|L|F|D|P|N)" + MID + "@.*name=" + IS_REPLACED + ",.*" + END;
        beforeMatching(STORE_OF_FIELD, regex);
    }

    public static final String STORE_P = PREFIX + "STORE_P" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_P, "StoreP");
    }

    public static final String STORE_P_OF_CLASS = COMPOSITE_PREFIX + "STORE_P_OF_CLASS" + POSTFIX;
    static {
        storeOfNodes(STORE_P_OF_CLASS, "StoreP");
    }

    public static final String STORE_VECTOR = PREFIX + "STORE_VECTOR" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_VECTOR, "StoreVector");
    }

    public static final String STORE_VECTOR_SCATTER = PREFIX + "STORE_VECTOR_SCATTER" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_VECTOR_SCATTER, "StoreVectorScatter");
    }

    public static final String STORE_VECTOR_MASKED = PREFIX + "STORE_VECTOR_MASKED" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_VECTOR_MASKED, "StoreVectorMasked");
    }

    public static final String STORE_VECTOR_SCATTER_MASKED = PREFIX + "STORE_VECTOR_SCATTER_MASKED" + POSTFIX;
    static {
        beforeMatchingNameRegex(STORE_VECTOR_SCATTER_MASKED, "StoreVectorScatterMasked");
    }

    public static final String SUB = PREFIX + "SUB" + POSTFIX;
    static {
        beforeMatchingNameRegex(SUB, "Sub(I|L|F|D|HF)");
    }

    public static final String SUB_D = PREFIX + "SUB_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(SUB_D, "SubD");
    }

    public static final String SUB_F = PREFIX + "SUB_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(SUB_F, "SubF");
    }

    public static final String SUB_HF = PREFIX + "SUB_HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(SUB_HF, "SubHF");
    }

    public static final String SUB_I = PREFIX + "SUB_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(SUB_I, "SubI");
    }

    public static final String SUB_L = PREFIX + "SUB_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(SUB_L, "SubL");
    }

    public static final String SUB_VB = VECTOR_PREFIX + "SUB_VB" + POSTFIX;
    static {
        vectorNode(SUB_VB, "SubVB", TYPE_BYTE);
    }

    public static final String SUB_VS = VECTOR_PREFIX + "SUB_VS" + POSTFIX;
    static {
        vectorNode(SUB_VS, "SubVS", TYPE_SHORT);
    }

    public static final String SUB_VI = VECTOR_PREFIX + "SUB_VI" + POSTFIX;
    static {
        vectorNode(SUB_VI, "SubVI", TYPE_INT);
    }

    public static final String SUB_VL = VECTOR_PREFIX + "SUB_VL" + POSTFIX;
    static {
        vectorNode(SUB_VL, "SubVL", TYPE_LONG);
    }

    public static final String SUB_VHF = VECTOR_PREFIX + "SUB_VHF" + POSTFIX;
    static {
        vectorNode(SUB_VHF, "SubVHF", TYPE_SHORT);
    }

    public static final String SUB_VF = VECTOR_PREFIX + "SUB_VF" + POSTFIX;
    static {
        vectorNode(SUB_VF, "SubVF", TYPE_FLOAT);
    }

    public static final String SUB_VD = VECTOR_PREFIX + "SUB_VD" + POSTFIX;
    static {
        vectorNode(SUB_VD, "SubVD", TYPE_DOUBLE);
    }

    public static final String SUBTYPE_CHECK = PREFIX + "SUBTYPE_CHECK" + POSTFIX;
    static {
        beforeMatchingNameRegex(SUBTYPE_CHECK, "SubTypeCheck");
    }

    public static final String TRAP = PREFIX + "TRAP" + POSTFIX;
    static {
        trapNodes(TRAP, "reason");
    }

    public static final String DIV_HF = PREFIX + "DIV_HF" + POSTFIX;
    static {
        beforeMatchingNameRegex(DIV_HF, "DivHF");
    }

    public static final String UDIV_I = PREFIX + "UDIV_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(UDIV_I, "UDivI");
    }

    public static final String UDIV_L = PREFIX + "UDIV_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(UDIV_L, "UDivL");
    }

    public static final String UDIV_MOD_I = PREFIX + "UDIV_MOD_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(UDIV_MOD_I, "UDivModI");
    }

    public static final String UDIV_MOD_L = PREFIX + "UDIV_MOD_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(UDIV_MOD_L, "UDivModL");
    }

    public static final String UMOD_I = PREFIX + "UMOD_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(UMOD_I, "UModI");
    }

    public static final String UMOD_L = PREFIX + "UMOD_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(UMOD_L, "UModL");
    }

    public static final String UNHANDLED_TRAP = PREFIX + "UNHANDLED_TRAP" + POSTFIX;
    static {
        trapNodes(UNHANDLED_TRAP, "unhandled");
    }

    public static final String UNSTABLE_IF_TRAP = PREFIX + "UNSTABLE_IF_TRAP" + POSTFIX;
    static {
        trapNodes(UNSTABLE_IF_TRAP, "unstable_if");
    }

    public static final String UNREACHED_TRAP = PREFIX + "UNREACHED_TRAP" + POSTFIX;
    static {
        trapNodes(UNREACHED_TRAP, "unreached");
    }

    public static final String URSHIFT = PREFIX + "URSHIFT" + POSTFIX;
    static {
        beforeMatchingNameRegex(URSHIFT, "URShift(B|S|I|L)");
    }

    public static final String URSHIFT_B = PREFIX + "URSHIFT_B" + POSTFIX;
    static {
        beforeMatchingNameRegex(URSHIFT_B, "URShiftB");
    }

    public static final String URSHIFT_I = PREFIX + "URSHIFT_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(URSHIFT_I, "URShiftI");
    }

    public static final String URSHIFT_L = PREFIX + "URSHIFT_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(URSHIFT_L, "URShiftL");
    }

    public static final String URSHIFT_S = PREFIX + "URSHIFT_S" + POSTFIX;
    static {
        beforeMatchingNameRegex(URSHIFT_S, "URShiftS");
    }

    public static final String URSHIFT_VB = VECTOR_PREFIX + "URSHIFT_VB" + POSTFIX;
    static {
        vectorNode(URSHIFT_VB, "URShiftVB", TYPE_BYTE);
    }

    public static final String URSHIFT_VS = VECTOR_PREFIX + "URSHIFT_VS" + POSTFIX;
    static {
        vectorNode(URSHIFT_VS, "URShiftVS", TYPE_SHORT);
    }

    public static final String URSHIFT_VC = VECTOR_PREFIX + "URSHIFT_VC" + POSTFIX;
    static {
        vectorNode(URSHIFT_VC, "URShiftVS", TYPE_CHAR); // short computation with char type
    }

    public static final String URSHIFT_VI = VECTOR_PREFIX + "URSHIFT_VI" + POSTFIX;
    static {
        vectorNode(URSHIFT_VI, "URShiftVI", TYPE_INT);
    }

    public static final String URSHIFT_VL = VECTOR_PREFIX + "URSHIFT_VL" + POSTFIX;
    static {
        vectorNode(URSHIFT_VL, "URShiftVL", TYPE_LONG);
    }

    public static final String VAND_NOT_I = PREFIX + "VAND_NOT_I" + POSTFIX;
    static {
        machOnlyNameRegex(VAND_NOT_I, "vand_notI");
    }

    public static final String VAND_NOT_L = PREFIX + "VAND_NOT_L" + POSTFIX;
    static {
        machOnlyNameRegex(VAND_NOT_L, "vand_notL");
    }

    public static final String VAND_NOT_I_MASKED = PREFIX + "VAND_NOT_I_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VAND_NOT_I_MASKED, "vand_notI_masked");
    }

    public static final String VAND_NOT_L_MASKED = PREFIX + "VAND_NOT_L_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VAND_NOT_L_MASKED, "vand_notL_masked");
    }

    public static final String RISCV_VAND_NOTI_VX = PREFIX + "RISCV_VAND_NOTI_VX" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VAND_NOTI_VX, "vand_notI_vx");
    }

    public static final String RISCV_VAND_NOTL_VX = PREFIX + "RISCV_VAND_NOTL_VX" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VAND_NOTL_VX, "vand_notL_vx");
    }

    public static final String RISCV_VAND_NOTI_VX_MASKED = PREFIX + "RISCV_VAND_NOTI_VX_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VAND_NOTI_VX_MASKED, "vand_notI_vx_masked");
    }

    public static final String RISCV_VAND_NOTL_VX_MASKED = PREFIX + "RISCV_VAND_NOTL_VX_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VAND_NOTL_VX_MASKED, "vand_notL_vx_masked");
    }

    public static final String VECTOR_BLEND_B = VECTOR_PREFIX + "VECTOR_BLEND_B" + POSTFIX;
    static {
        vectorNode(VECTOR_BLEND_B, "VectorBlend", TYPE_BYTE);
    }

    public static final String VECTOR_BLEND_S = VECTOR_PREFIX + "VECTOR_BLEND_S" + POSTFIX;
    static {
        vectorNode(VECTOR_BLEND_S, "VectorBlend", TYPE_SHORT);
    }

    public static final String VECTOR_BLEND_I = VECTOR_PREFIX + "VECTOR_BLEND_I" + POSTFIX;
    static {
        vectorNode(VECTOR_BLEND_I, "VectorBlend", TYPE_INT);
    }

    public static final String VECTOR_BLEND_L = VECTOR_PREFIX + "VECTOR_BLEND_L" + POSTFIX;
    static {
        vectorNode(VECTOR_BLEND_L, "VectorBlend", TYPE_LONG);
    }

    public static final String VECTOR_BLEND_F = VECTOR_PREFIX + "VECTOR_BLEND_F" + POSTFIX;
    static {
        vectorNode(VECTOR_BLEND_F, "VectorBlend", TYPE_FLOAT);
    }

    public static final String VECTOR_BLEND_D = VECTOR_PREFIX + "VECTOR_BLEND_D" + POSTFIX;
    static {
        vectorNode(VECTOR_BLEND_D, "VectorBlend", TYPE_DOUBLE);
    }

    public static final String VECTOR_MASK_CMP_I = VECTOR_PREFIX + "VECTOR_MASK_CMP_I" + POSTFIX;
    static {
        vectorNode(VECTOR_MASK_CMP_I, "VectorMaskCmp", TYPE_INT);
    }

    public static final String VECTOR_MASK_CMP_L = VECTOR_PREFIX + "VECTOR_MASK_CMP_L" + POSTFIX;
    static {
        vectorNode(VECTOR_MASK_CMP_L, "VectorMaskCmp", TYPE_LONG);
    }

    public static final String VECTOR_MASK_CMP_F = VECTOR_PREFIX + "VECTOR_MASK_CMP_F" + POSTFIX;
    static {
        vectorNode(VECTOR_MASK_CMP_F, "VectorMaskCmp", TYPE_FLOAT);
    }

    public static final String VECTOR_MASK_CMP_D = VECTOR_PREFIX + "VECTOR_MASK_CMP_D" + POSTFIX;
    static {
        vectorNode(VECTOR_MASK_CMP_D, "VectorMaskCmp", TYPE_DOUBLE);
    }

    public static final String VECTOR_CAST_B2S = VECTOR_PREFIX + "VECTOR_CAST_B2S" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_B2S, "VectorCastB2X", TYPE_SHORT);
    }

    public static final String VECTOR_CAST_B2I = VECTOR_PREFIX + "VECTOR_CAST_B2I" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_B2I, "VectorCastB2X", TYPE_INT);
    }

    public static final String VECTOR_CAST_B2L = VECTOR_PREFIX + "VECTOR_CAST_B2L" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_B2L, "VectorCastB2X", TYPE_LONG);
    }

    public static final String VECTOR_CAST_B2F = VECTOR_PREFIX + "VECTOR_CAST_B2F" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_B2F, "VectorCastB2X", TYPE_FLOAT);
    }

    public static final String VECTOR_CAST_B2D = VECTOR_PREFIX + "VECTOR_CAST_B2D" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_B2D, "VectorCastB2X", TYPE_DOUBLE);
    }

    public static final String VECTOR_CAST_D2B = VECTOR_PREFIX + "VECTOR_CAST_D2B" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_D2B, "VectorCastD2X", TYPE_BYTE);
    }

    public static final String VECTOR_CAST_D2S = VECTOR_PREFIX + "VECTOR_CAST_D2S" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_D2S, "VectorCastD2X", TYPE_SHORT);
    }

    public static final String VECTOR_CAST_D2I = VECTOR_PREFIX + "VECTOR_CAST_D2I" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_D2I, "VectorCastD2X", TYPE_INT);
    }

    public static final String VECTOR_CAST_D2L = VECTOR_PREFIX + "VECTOR_CAST_D2L" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_D2L, "VectorCastD2X", TYPE_LONG);
    }

    public static final String VECTOR_CAST_D2F = VECTOR_PREFIX + "VECTOR_CAST_D2F" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_D2F, "VectorCastD2X", TYPE_FLOAT);
    }

    public static final String VECTOR_CAST_F2B = VECTOR_PREFIX + "VECTOR_CAST_F2B" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_F2B, "VectorCastF2X", TYPE_BYTE);
    }

    public static final String VECTOR_CAST_F2S = VECTOR_PREFIX + "VECTOR_CAST_F2S" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_F2S, "VectorCastF2X", TYPE_SHORT);
    }

    public static final String VECTOR_CAST_F2I = VECTOR_PREFIX + "VECTOR_CAST_F2I" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_F2I, "VectorCastF2X", TYPE_INT);
    }

    public static final String VECTOR_CAST_F2L = VECTOR_PREFIX + "VECTOR_CAST_F2L" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_F2L, "VectorCastF2X", TYPE_LONG);
    }

    public static final String VECTOR_CAST_F2D = VECTOR_PREFIX + "VECTOR_CAST_F2D" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_F2D, "VectorCastF2X", TYPE_DOUBLE);
    }

    public static final String VECTOR_CAST_I2B = VECTOR_PREFIX + "VECTOR_CAST_I2B" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_I2B, "VectorCastI2X", TYPE_BYTE);
    }

    public static final String VECTOR_CAST_I2S = VECTOR_PREFIX + "VECTOR_CAST_I2S" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_I2S, "VectorCastI2X", TYPE_SHORT);
    }

    public static final String VECTOR_CAST_I2L = VECTOR_PREFIX + "VECTOR_CAST_I2L" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_I2L, "VectorCastI2X", TYPE_LONG);
    }

    public static final String VECTOR_CAST_I2F = VECTOR_PREFIX + "VECTOR_CAST_I2F" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_I2F, "VectorCastI2X", TYPE_FLOAT);
    }

    public static final String VECTOR_CAST_I2D = VECTOR_PREFIX + "VECTOR_CAST_I2D" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_I2D, "VectorCastI2X", TYPE_DOUBLE);
    }

    public static final String VECTOR_CAST_L2B = VECTOR_PREFIX + "VECTOR_CAST_L2B" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_L2B, "VectorCastL2X", TYPE_BYTE);
    }

    public static final String VECTOR_CAST_L2S = VECTOR_PREFIX + "VECTOR_CAST_L2S" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_L2S, "VectorCastL2X", TYPE_SHORT);
    }

    public static final String VECTOR_CAST_L2I = VECTOR_PREFIX + "VECTOR_CAST_L2I" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_L2I, "VectorCastL2X", TYPE_INT);
    }

    public static final String VECTOR_CAST_L2F = VECTOR_PREFIX + "VECTOR_CAST_L2F" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_L2F, "VectorCastL2X", TYPE_FLOAT);
    }

    public static final String VECTOR_CAST_L2D = VECTOR_PREFIX + "VECTOR_CAST_L2D" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_L2D, "VectorCastL2X", TYPE_DOUBLE);
    }

    public static final String VECTOR_CAST_S2B = VECTOR_PREFIX + "VECTOR_CAST_S2B" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_S2B, "VectorCastS2X", TYPE_BYTE);
    }

    public static final String VECTOR_CAST_S2I = VECTOR_PREFIX + "VECTOR_CAST_S2I" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_S2I, "VectorCastS2X", TYPE_INT);
    }

    public static final String VECTOR_CAST_S2L = VECTOR_PREFIX + "VECTOR_CAST_S2L" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_S2L, "VectorCastS2X", TYPE_LONG);
    }

    public static final String VECTOR_CAST_S2F = VECTOR_PREFIX + "VECTOR_CAST_S2F" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_S2F, "VectorCastS2X", TYPE_FLOAT);
    }

    public static final String VECTOR_CAST_S2D = VECTOR_PREFIX + "VECTOR_CAST_S2D" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_S2D, "VectorCastS2X", TYPE_DOUBLE);
    }

    public static final String VECTOR_CAST_F2HF = VECTOR_PREFIX + "VECTOR_CAST_F2HF" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_F2HF, "VectorCastF2HF", TYPE_SHORT);
    }

    public static final String VECTOR_CAST_HF2F = VECTOR_PREFIX + "VECTOR_CAST_HF2F" + POSTFIX;
    static {
        vectorNode(VECTOR_CAST_HF2F, "VectorCastHF2F", TYPE_FLOAT);
    }

    public static final String VECTOR_MASK_CAST = PREFIX + "VECTOR_MASK_CAST" + POSTFIX;
    static {
        beforeMatchingNameRegex(VECTOR_MASK_CAST, "VectorMaskCast");
    }

    public static final String VECTOR_REINTERPRET = PREFIX + "VECTOR_REINTERPRET" + POSTFIX;
    static {
        beforeMatchingNameRegex(VECTOR_REINTERPRET, "VectorReinterpret");
    }

    public static final String VECTOR_UCAST_B2S = VECTOR_PREFIX + "VECTOR_UCAST_B2S" + POSTFIX;
    static {
        vectorNode(VECTOR_UCAST_B2S, "VectorUCastB2X", TYPE_SHORT);
    }

    public static final String VECTOR_UCAST_B2I = VECTOR_PREFIX + "VECTOR_UCAST_B2I" + POSTFIX;
    static {
        vectorNode(VECTOR_UCAST_B2I, "VectorUCastB2X", TYPE_INT);
    }

    public static final String VECTOR_UCAST_B2L = VECTOR_PREFIX + "VECTOR_UCAST_B2L" + POSTFIX;
    static {
        vectorNode(VECTOR_UCAST_B2L, "VectorUCastB2X", TYPE_LONG);
    }

    public static final String VECTOR_UCAST_I2L = VECTOR_PREFIX + "VECTOR_UCAST_I2L" + POSTFIX;
    static {
        vectorNode(VECTOR_UCAST_I2L, "VectorUCastI2X", TYPE_LONG);
    }

    public static final String VECTOR_UCAST_S2I = VECTOR_PREFIX + "VECTOR_UCAST_S2I" + POSTFIX;
    static {
        vectorNode(VECTOR_UCAST_S2I, "VectorUCastS2X", TYPE_INT);
    }

    public static final String VECTOR_UCAST_S2L = VECTOR_PREFIX + "VECTOR_UCAST_S2L" + POSTFIX;
    static {
        vectorNode(VECTOR_UCAST_S2L, "VectorUCastS2X", TYPE_LONG);
    }

    public static final String VECTOR_TEST = PREFIX + "VECTOR_TEST" + POSTFIX;
    static {
        beforeMatchingNameRegex(VECTOR_TEST, "VectorTest");
    }

    public static final String VFABD = PREFIX + "VFABD" + POSTFIX;
    static {
        machOnlyNameRegex(VFABD, "vfabd");
    }

    public static final String VFABD_MASKED = PREFIX + "VFABD_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VFABD_MASKED, "vfabd_masked");
    }

    public static final String VFMSB_MASKED = PREFIX + "VFMSB_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VFMSB_MASKED, "vfmsb_masked");
    }

    public static final String RISCV_VFNMSUB_MASKED = PREFIX + "RISCV_VFNMSUB_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VFNMSUB_MASKED, "vfnmsub_masked");
    }

    public static final String VFNMAD_MASKED = PREFIX + "VFNMAD_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VFNMAD_MASKED, "vfnmad_masked");
    }

    public static final String RISCV_VFNMADD_MASKED = PREFIX + "RISCV_VFNMADD_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VFNMADD_MASKED, "vfnmadd_masked");
    }

    public static final String VFNMSB_MASKED = PREFIX + "VFNMSB_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VFNMSB_MASKED, "vfnmsb_masked");
    }

    public static final String RISCV_VFMSUB_MASKED = PREFIX + "RISCV_VFMSUB_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VFMSUB_MASKED, "vfmsub_masked");
    }

    public static final String VFMAD_MASKED = PREFIX + "VFMAD_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VFMAD_MASKED, "vfmad_masked");
    }

    public static final String RISCV_VFMADD_MASKED = PREFIX + "RISCV_VFMADD_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(RISCV_VFMADD_MASKED, "vfmadd_masked");
    }

    public static final String VMASK_AND_NOT_L = PREFIX + "VMASK_AND_NOT_L" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_AND_NOT_L, "vmask_and_notL");
    }

    public static final String VMLA = PREFIX + "VMLA" + POSTFIX;
    static {
        machOnlyNameRegex(VMLA, "vmla");
    }

    public static final String VMLA_MASKED = PREFIX + "VMLA_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VMLA_MASKED, "vmla_masked");
    }

    public static final String FMSUB = PREFIX + "FMSUB" + POSTFIX;
    static {
        machOnlyNameRegex(FMSUB, "msub(F|D)_reg_reg");
    }

    public static final String FNMADD = PREFIX + "FNMADD" + POSTFIX;
    static {
        machOnlyNameRegex(FNMADD, "mnadd(F|D)_reg_reg");
    }

    public static final String FNMSUB = PREFIX + "FNMSUB" + POSTFIX;
    static {
        machOnlyNameRegex(FNMSUB, "mnsub(F|D)_reg_reg");
    }

    public static final String FMA_F = PREFIX + "FMA_F" + POSTFIX;
    static {
        beforeMatchingNameRegex(FMA_F, "FmaF");
    }

    public static final String FMA_D = PREFIX + "FMA_D" + POSTFIX;
    static {
        beforeMatchingNameRegex(FMA_D, "FmaD");
    }

    public static final String VFMLA = PREFIX + "VFMLA" + POSTFIX;
    static {
        machOnlyNameRegex(VFMLA, "vfmla");
    }

    public static final String VFMLS = PREFIX + "VFMLS" + POSTFIX;
    static {
        machOnlyNameRegex(VFMLS, "vfmls");
    }

    public static final String VFNMLA = PREFIX + "VFNMLA" + POSTFIX;
    static {
        machOnlyNameRegex(VFNMLA, "vfnmla");
    }

    public static final String VMLS = PREFIX + "VMLS" + POSTFIX;
    static {
        machOnlyNameRegex(VMLS, "vmls");
    }

    public static final String VMLS_MASKED = PREFIX + "VMLS_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VMLS_MASKED, "vmls_masked");
    }

    public static final String VMASK_CMP_ZERO_I_NEON = PREFIX + "VMASK_CMP_ZERO_I_NEON" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMP_ZERO_I_NEON, "vmaskcmp_zeroI_neon");
    }

    public static final String VMASK_CMP_ZERO_L_NEON = PREFIX + "VMASK_CMP_ZERO_L_NEON" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMP_ZERO_L_NEON, "vmaskcmp_zeroL_neon");
    }

    public static final String VMASK_CMP_ZERO_F_NEON = PREFIX + "VMASK_CMP_ZERO_F_NEON" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMP_ZERO_F_NEON, "vmaskcmp_zeroF_neon");
    }

    public static final String VMASK_CMP_ZERO_D_NEON = PREFIX + "VMASK_CMP_ZERO_D_NEON" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMP_ZERO_D_NEON, "vmaskcmp_zeroD_neon");
    }

    public static final String VMASK_CMP_IMM_I_SVE = PREFIX + "VMASK_CMP_IMM_I_SVE" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMP_IMM_I_SVE, "vmaskcmp_immI_sve");
    }

    public static final String VMASK_CMPU_IMM_I_SVE = PREFIX + "VMASK_CMPU_IMM_I_SVE" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMPU_IMM_I_SVE, "vmaskcmpU_immI_sve");
    }

    public static final String VMASK_CMP_IMM_L_SVE = PREFIX + "VMASK_CMP_IMM_L_SVE" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMP_IMM_L_SVE, "vmaskcmp_immL_sve");
    }

    public static final String VMASK_CMPU_IMM_L_SVE = PREFIX + "VMASK_CMPU_IMM_L_SVE" + POSTFIX;
    static {
        machOnlyNameRegex(VMASK_CMPU_IMM_L_SVE, "vmaskcmpU_immL_sve");
    }

    public static final String VNOT_I_MASKED = PREFIX + "VNOT_I_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VNOT_I_MASKED, "vnotI_masked");
    }

    public static final String VNOT_L_MASKED = PREFIX + "VNOT_L_MASKED" + POSTFIX;
    static {
        machOnlyNameRegex(VNOT_L_MASKED, "vnotL_masked");
    }

    public static final String VSTOREMASK_TRUECOUNT = PREFIX + "VSTOREMASK_TRUECOUNT" + POSTFIX;
    static {
        machOnlyNameRegex(VSTOREMASK_TRUECOUNT, "vstoremask_truecount_neon");
    }

    public static final String XOR = PREFIX + "XOR" + POSTFIX;
    static {
        beforeMatchingNameRegex(XOR, "Xor(I|L)");
    }

    public static final String XOR_I = PREFIX + "XOR_I" + POSTFIX;
    static {
        beforeMatchingNameRegex(XOR_I, "XorI");
    }

    public static final String XOR_L = PREFIX + "XOR_L" + POSTFIX;
    static {
        beforeMatchingNameRegex(XOR_L, "XorL");
    }

    public static final String XOR_VB = VECTOR_PREFIX + "XOR_VB" + POSTFIX;
    static {
        vectorNode(XOR_VB, "XorV", TYPE_BYTE);
    }

    public static final String XOR_VS = VECTOR_PREFIX + "XOR_VS" + POSTFIX;
    static {
        vectorNode(XOR_VS, "XorV", TYPE_SHORT);
    }

    public static final String XOR_VI = VECTOR_PREFIX + "XOR_VI" + POSTFIX;
    static {
        vectorNode(XOR_VI, "XorV", TYPE_INT);
    }

    public static final String XOR_VL = VECTOR_PREFIX + "XOR_VL" + POSTFIX;
    static {
        vectorNode(XOR_VL, "XorV", TYPE_LONG);
    }

    public static final String XOR_V_MASK = PREFIX + "XOR_V_MASK" + POSTFIX;
    static {
        beforeMatchingNameRegex(XOR_V_MASK, "XorVMask");
    }

    public static final String XOR_REDUCTION_V = PREFIX + "XOR_REDUCTION_V" + POSTFIX;
    static {
        superWordNodes(XOR_REDUCTION_V, "XorReductionV");
    }

    public static final String XOR3_NEON = PREFIX + "XOR3_NEON" + POSTFIX;
    static {
        machOnlyNameRegex(XOR3_NEON, "veor3_neon");
    }

    public static final String XOR3_SVE = PREFIX + "XOR3_SVE" + POSTFIX;
    static {
        machOnlyNameRegex(XOR3_SVE, "veor3_sve");
    }

    public static final String COMPRESS_BITS_VI = VECTOR_PREFIX + "COMPRESS_BITS_VI" + POSTFIX;
    static {
        vectorNode(COMPRESS_BITS_VI, "CompressBitsV", TYPE_INT);
    }

    public static final String COMPRESS_BITS_VL = VECTOR_PREFIX + "COMPRESS_BITS_VL" + POSTFIX;
    static {
        vectorNode(COMPRESS_BITS_VL, "CompressBitsV", TYPE_LONG);
    }

    public static final String EXPAND_BITS_VI = VECTOR_PREFIX + "EXPAND_BITS_VI" + POSTFIX;
    static {
        vectorNode(EXPAND_BITS_VI, "ExpandBitsV", TYPE_INT);
    }

    public static final String EXPAND_BITS_VL = VECTOR_PREFIX + "EXPAND_BITS_VL" + POSTFIX;
    static {
        vectorNode(EXPAND_BITS_VL, "ExpandBitsV", TYPE_LONG);
    }

    public static final String Z_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "zLoadP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(Z_LOAD_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String Z_STORE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_STORE_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "zStoreP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(Z_STORE_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "zCompareAndSwapP" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String Z_GET_AND_SET_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_GET_AND_SET_P_WITH_BARRIER_FLAG" + POSTFIX;
    static {
        String regex = START + "(zXChgP)|(zGetAndSetP\\S*)" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
        machOnly(Z_GET_AND_SET_P_WITH_BARRIER_FLAG, regex);
    }

    public static final String X86_LOCK_ADDB_REG = PREFIX + "X86_LOCK_ADDB_REG" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDB_REG, "xaddB_reg_no_res");
    }

    public static final String X86_LOCK_ADDB_IMM = PREFIX + "X86_LOCK_ADDB_IMM" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDB_IMM, "xaddB_imm_no_res");
    }

    public static final String X86_LOCK_XADDB = PREFIX + "X86_LOCK_XADDB" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_XADDB, "xaddB");
    }

    public static final String X86_LOCK_ADDS_REG = PREFIX + "X86_LOCK_ADDS_REG" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDS_REG, "xaddS_reg_no_res");
    }

    public static final String X86_LOCK_ADDS_IMM = PREFIX + "X86_LOCK_ADDS_IMM" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDS_IMM, "xaddS_imm_no_res");
    }

    public static final String X86_LOCK_XADDS = PREFIX + "X86_LOCK_XADDS" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_XADDS, "xaddS");
    }

    public static final String X86_LOCK_ADDI_REG = PREFIX + "X86_LOCK_ADDI_REG" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDI_REG, "xaddI_reg_no_res");
    }

    public static final String X86_LOCK_ADDI_IMM = PREFIX + "X86_LOCK_ADDI_IMM" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDI_IMM, "xaddI_imm_no_res");
    }

    public static final String X86_LOCK_XADDI = PREFIX + "X86_LOCK_XADDI" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_XADDI, "xaddI");
    }

    public static final String X86_LOCK_ADDL_REG = PREFIX + "X86_LOCK_ADDL_REG" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDL_REG, "xaddL_reg_no_res");
    }

    public static final String X86_LOCK_ADDL_IMM = PREFIX + "X86_LOCK_ADDL_IMM" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_ADDL_IMM, "xaddL_imm_no_res");
    }

    public static final String X86_LOCK_XADDL = PREFIX + "X86_LOCK_XADDL" + POSTFIX;
    static {
        machOnlyNameRegex(X86_LOCK_XADDL, "xaddL");
    }

    public static final String X86_TESTI_REG = PREFIX + "X86_TESTI_REG" + POSTFIX;
    static {
        machOnlyNameRegex(X86_TESTI_REG, "testI_reg");
    }

    public static final String X86_TESTL_REG = PREFIX + "X86_TESTL_REG" + POSTFIX;
    static {
        machOnlyNameRegex(X86_TESTL_REG, "testL_reg");
    }

    public static final String X86_CMOVEL_IMM01 = PREFIX + "X86_CMOVEL_IMM01" + POSTFIX;
    static {
        machOnlyNameRegex(X86_CMOVEL_IMM01, "cmovL_imm_01");
    }

    public static final String X86_CMOVEL_IMM01U = PREFIX + "X86_CMOVEL_IMM01U" + POSTFIX;
    static {
        machOnlyNameRegex(X86_CMOVEL_IMM01U, "cmovL_imm_01U");
    }

    public static final String X86_CMOVEL_IMM01UCF = PREFIX + "X86_CMOVEL_IMM01UCF" + POSTFIX;
    static {
        machOnlyNameRegex(X86_CMOVEL_IMM01UCF, "cmovL_imm_01UCF");
    }

    public static final String MOD_F = PREFIX + "MOD_F" + POSTFIX;
    static {
        String regex = START + "ModF" + MID + END;
        macroNodes(MOD_F, regex);
    }

    public static final String MOD_D = PREFIX + "MOD_D" + POSTFIX;
    static {
        String regex = START + "ModD" + MID + END;
        macroNodes(MOD_D, regex);
    }

    public static final String BLACKHOLE = PREFIX + "BLACKHOLE" + POSTFIX;
    static {
        fromBeforeRemoveUselessToFinalCode(BLACKHOLE, "Blackhole");
    }

    /*
     * Utility methods to set up IR_NODE_MAPPINGS.
     */

    /**
     * Apply {@code regex} on all machine independent ideal graph phases up to and including
     * {@link CompilePhase#BEFORE_MATCHING}.
     */
    private static void beforeMatching(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
    }

    /**
     * Apply {@code irNodeRegex} as regex for the IR node name on all machine independent ideal graph phases up to and
     * including {@link CompilePhase#BEFORE_MATCHING}.
     */
    private static void beforeMatchingNameRegex(String irNodePlaceholder, String irNodeRegex) {
        String regex = START + irNodeRegex + MID + END;
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
    }

    /**
     * Apply {@code irNodeRegex} as regex for the IR vector node name on all machine independent ideal graph phases up to and
     * including {@link CompilePhase#BEFORE_MATCHING}. Since this is a vector node, we can also check the vector element
     * type {@code typeString} and the vector size (number of elements), {@see VECTOR_SIZE}.
     */
    private static void vectorNode(String irNodePlaceholder, String irNodeRegex, String typeString) {
        TestFramework.check(isVectorIRNode(irNodePlaceholder), "vectorNode: failed prefix check for irNodePlaceholder "
                                                               + irNodePlaceholder + " -> did you use VECTOR_PREFIX?");
        // IS_REPLACED is later replaced with the specific type and size of the vector.
        String regex = START + irNodeRegex + MID  + IS_REPLACED + END;
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
        VECTOR_NODE_TYPE.put(irNodePlaceholder, typeString);
    }

    /**
     * Apply {@code regex} on all ideal graph phases up to and including {@link CompilePhase#BEFORE_MACRO_EXPANSION}.
     */
    private static void macroNodes(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.BEFORE_MACRO_EXPANSION, regex,
                                                                          CompilePhase.BEFORE_STRINGOPTS,
                                                                          CompilePhase.BEFORE_MACRO_EXPANSION));
    }

    private static void callOfNodes(String irNodePlaceholder, String callRegex) {
        String regex = START + callRegex + MID + IS_REPLACED + " " +  END;
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
    }

    /**
     * Apply {@code regex} on all machine dependant ideal graph phases (i.e. on the mach graph) starting from
     * {@link CompilePhase#MATCHING}.
     */
    private static void optoOnly(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.OPTO_ASSEMBLY, regex));
    }

    private static void machOnly(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.MACH, regex));
    }

    private static void machOnlyNameRegex(String irNodePlaceholder, String irNodeRegex) {
        String regex = START + irNodeRegex + MID + END;
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.MACH, regex));
    }

    /**
     * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#AFTER_CLOOPS}.
     */
    private static void fromAfterCountedLoops(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
                                                                          CompilePhase.AFTER_CLOOPS,
                                                                          CompilePhase.FINAL_CODE));
    }

    /**
     * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS}.
     */
    private static void fromBeforeCountedLoops(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
                                                                          CompilePhase.BEFORE_CLOOPS,
                                                                          CompilePhase.FINAL_CODE));
    }

    /**
     * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS} up to and
     * including {@link CompilePhase#BEFORE_MATCHING}
     */
    private static void fromMacroToBeforeMatching(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
                                                                          CompilePhase.AFTER_MACRO_EXPANSION,
                                                                          CompilePhase.BEFORE_MATCHING));
    }

    /**
     * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS} up to and
     * including {@link CompilePhase#BEFORE_MATCHING}
     */
    private static void afterBarrierExpansionToBeforeMatching(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
                                                                          CompilePhase.OPTIMIZE_FINISHED,
                                                                          CompilePhase.BEFORE_MATCHING));
    }

    /**
     * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_LOOP_OPTS}
     * up to and including {@link CompilePhase#AFTER_LOOP_OPTS}.
     */
    private static void duringLoopOpts(String irNodePlaceholder, String regex) {
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.AFTER_LOOP_OPTS, regex,
                                                                          CompilePhase.BEFORE_LOOP_OPTS,
                                                                          CompilePhase.AFTER_LOOP_OPTS));
    }

    private static void trapNodes(String irNodePlaceholder, String trapReason) {
        String regex = START + "CallStaticJava" + MID + "uncommon_trap.*" + trapReason + END;
        beforeMatching(irNodePlaceholder, regex);
    }

    private static void parsePredicateNodes(String irNodePlaceholder, String label) {
        String regex = START + "ParsePredicate" + MID + "#" + label + " " + END;
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.AFTER_PARSING, regex,
                                                                          CompilePhase.AFTER_PARSING,
                                                                          CompilePhase.AFTER_LOOP_OPTS));
    }

    private static void loadOfNodes(String irNodePlaceholder, String irNodeRegex) {
        String regex = START + irNodeRegex + MID + "@\\S*" + IS_REPLACED + LOAD_OF_CLASS_POSTFIX;
        beforeMatching(irNodePlaceholder, regex);
    }

    private static void storeOfNodes(String irNodePlaceholder, String irNodeRegex) {
        String regex = START + irNodeRegex + MID + "@\\S*" + IS_REPLACED + STORE_OF_CLASS_POSTFIX;
        beforeMatching(irNodePlaceholder, regex);
    }

    private static void fromBeforeRemoveUselessToFinalCode(String irNodePlaceholder, String irNodeRegex) {
        String regex = START + irNodeRegex + MID + END;
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
                CompilePhase.BEFORE_REMOVEUSELESS,
                CompilePhase.FINAL_CODE));
    }

    /**
     * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#PHASEIDEALLOOP1} which is the
     * first phase that could contain vector nodes from super word.
     */
    private static void superWordNodes(String irNodePlaceholder, String irNodeRegex) {
        String regex = START + irNodeRegex + MID + END;
        IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
                                                                          CompilePhase.PHASEIDEALLOOP1,
                                                                          CompilePhase.BEFORE_MATCHING));
    }


    /*
     * Methods used internally by the IR framework.
     */

    /**
     * Is {@code irNodeString} an IR node placeholder string?
     */
    public static boolean isIRNode(String irNodeString) {
        return irNodeString.startsWith(PREFIX);
    }

    /**
     * Is {@code irCompositeNodeString} an IR composite node placeholder string?
     */
    public static boolean isCompositeIRNode(String irCompositeNodeString) {
        return irCompositeNodeString.startsWith(COMPOSITE_PREFIX);
    }

    /**
     * Is {@code irVectorNodeString} an IR vector node placeholder string?
     */
    public static boolean isVectorIRNode(String irVectorNodeString) {
        return irVectorNodeString.startsWith(VECTOR_PREFIX);
    }

    /**
     * Is {@code irVectorSizeString} a vector size string?
     */
    public static boolean isVectorSize(String irVectorSizeString) {
        return irVectorSizeString.startsWith(VECTOR_SIZE);
    }

    /**
     * Parse {@code sizeString} and generate a regex pattern to match for the size in the IR dump.
     */
    public static String parseVectorNodeSize(String sizeString, String typeString, VMInfo vmInfo) {
        if (sizeString.equals(VECTOR_SIZE_TAG_ANY)) {
            return "\\\\d+"; // match with any number
        }
        // Try to parse any tags, convert to comma separated list of ints
        sizeString = parseVectorNodeSizeTag(sizeString, typeString, vmInfo);
        // Parse comma separated list of numbers
        String[] sizes = sizeString.split(",");
        String regex = "";
        for (int i = 0; i < sizes.length; i++) {
            int size = 0;
            try {
                size = Integer.parseInt(sizes[i]);
            } catch (NumberFormatException e) {
                throw new TestFormatException("Vector node has invalid size \"" + sizes[i] + "\", in \"" + sizeString + "\"");
            }
            TestFormat.checkNoReport(size > 1, "Vector node size must be 2 or larger, but got \"" + sizes[i] + "\", in \"" + sizeString + "\"");
            regex += ((i > 0) ? "|" : "") + size;
        }
        if (sizes.length > 1) {
           regex = "(" + regex + ")";
        }
        return regex;
    }

    /**
     * If {@code sizeTagString} is a size tag, return the list of accepted sizes, else return sizeTagString.
     */
    public static String parseVectorNodeSizeTag(String sizeTagString, String typeString, VMInfo vmInfo) {
        // Parse out "min(a,b,c,...)"
        if (sizeTagString.startsWith("min(") && sizeTagString.endsWith(")")) {
            return parseVectorNodeSizeTagMin(sizeTagString, typeString, vmInfo);
        }

        // Parse individual tags
        return switch (sizeTagString) {
            case VECTOR_SIZE_TAG_MAX -> String.valueOf(getMaxElementsForType(typeString, vmInfo));
            case "max_byte"          -> String.valueOf(getMaxElementsForType(TYPE_BYTE, vmInfo));
            case "max_char"          -> String.valueOf(getMaxElementsForType(TYPE_CHAR, vmInfo));
            case "max_short"         -> String.valueOf(getMaxElementsForType(TYPE_SHORT, vmInfo));
            case "max_int"           -> String.valueOf(getMaxElementsForType(TYPE_INT, vmInfo));
            case "max_long"          -> String.valueOf(getMaxElementsForType(TYPE_LONG, vmInfo));
            case "max_float"         -> String.valueOf(getMaxElementsForType(TYPE_FLOAT, vmInfo));
            case "max_double"        -> String.valueOf(getMaxElementsForType(TYPE_DOUBLE, vmInfo));
            case "LoopMaxUnroll"     -> String.valueOf(vmInfo.getLongValue("LoopMaxUnroll"));
            default                  -> sizeTagString;
        };
    }

    /**
     * Parse {@code sizeTagString}, which must be a min-clause.
     */
    public static String parseVectorNodeSizeTagMin(String sizeTagString, String typeString, VMInfo vmInfo) {
        String[] tags = sizeTagString.substring(4, sizeTagString.length() - 1).split(",");
        TestFormat.checkNoReport(tags.length > 1, "Vector node size \"min(...)\" must have at least 2 comma separated arguments, got \"" + sizeTagString + "\"");
        int minVal = 1024;
        for (int i = 0; i < tags.length; i++) {
            String tag = parseVectorNodeSizeTag(tags[i].trim(), typeString, vmInfo);
            int tag_val = 0;
            try {
                tag_val = Integer.parseInt(tag);
            } catch (NumberFormatException e) {
                throw new TestFormatException("Vector node has invalid size in \"min(...)\", argument " + i + ", \"" + tag + "\", in \"" + sizeTagString + "\"");
            }
            minVal = Math.min(minVal, tag_val);
        }
        return String.valueOf(minVal);
    }

    /**
     * Return maximal number of elements that can fit in a vector of the specified type.
     */
    public static long getMaxElementsForType(String typeString, VMInfo vmInfo) {
        long maxVectorSize = vmInfo.getLongValue("MaxVectorSize");
        TestFormat.checkNoReport(maxVectorSize > 0, "VMInfo: MaxVectorSize is not larger than zero");
        long maxBytes = maxVectorSize;

        if (Platform.isX64() || Platform.isX86()) {
            maxBytes = Math.min(maxBytes, getMaxElementsForTypeOnX86(typeString, vmInfo));
        }

        // compute elements per vector: vector bytes divided by bytes per element
        int bytes = getTypeSizeInBytes(typeString);
        return maxBytes / bytes;
    }

    /**
     * Return maximal number of elements that can fit in a vector of the specified type, on x86 / x64.
     */
    public static long getMaxElementsForTypeOnX86(String typeString, VMInfo vmInfo) {
        // restrict maxBytes for specific features, see Matcher::vector_width_in_bytes in x86.ad:
        boolean avx1 = vmInfo.hasCPUFeature("avx");
        boolean avx2 = vmInfo.hasCPUFeature("avx2");
        boolean avx512 = vmInfo.hasCPUFeature("avx512f");
        boolean avx512bw = vmInfo.hasCPUFeature("avx512bw");
        long maxBytes;
        if (avx512) {
            maxBytes = 64;
        } else if (avx2) {
            maxBytes = 32;
        } else {
            maxBytes = 16;
        }
        if (avx1 && (typeString.equals(TYPE_FLOAT) || typeString.equals(TYPE_DOUBLE))) {
            maxBytes = avx512 ? 64 : 32;
        }
        if (avx512 && (typeString.equals(TYPE_BYTE) || typeString.equals(TYPE_SHORT) || typeString.equals(TYPE_CHAR))) {
            maxBytes = avx512bw ? 64 : 32;
        }

        return maxBytes;
    }

    /**
     * Return size in bytes of type named by {@code typeString}, return 0 if it does not name a type.
     */
    public static int getTypeSizeInBytes(String typeString) {
        return switch (typeString) {
            case TYPE_BYTE              -> 1;
            case TYPE_CHAR, TYPE_SHORT  -> 2;
            case TYPE_INT, TYPE_FLOAT   -> 4;
            case TYPE_LONG, TYPE_DOUBLE -> 8;
            default                     -> 0;
        };
    }

    /**
     * Returns "IRNode.XYZ", where XYZ is one of the IR node placeholder variable names defined above.
     */
    public static String getIRNodeAccessString(String irNodeString) {
        int prefixLength;
        if (isCompositeIRNode(irNodeString)) {
            TestFramework.check(irNodeString.length() > COMPOSITE_PREFIX.length() + POSTFIX.length(),
                                "Invalid composite node placeholder: " + irNodeString);
            prefixLength = COMPOSITE_PREFIX.length();
        } else if (isVectorIRNode(irNodeString)) {
            TestFramework.check(irNodeString.length() > VECTOR_PREFIX.length() + POSTFIX.length(),
                                "Invalid vector node placeholder: " + irNodeString);
            prefixLength = VECTOR_PREFIX.length();
        } else {
            prefixLength = PREFIX.length();
        }
        return "IRNode." + irNodeString.substring(prefixLength, irNodeString.length() - POSTFIX.length());
    }

    /**
     * Is this IR node supported on current platform, used VM build, etc.?
     * Throws a {@link CheckedTestFrameworkException} if the IR node is unsupported.
     */
    public static void checkIRNodeSupported(String node) throws CheckedTestFrameworkException {
        switch (node) {
            case INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP -> {
                if (!WhiteBox.getWhiteBox().isJVMCISupportedByGC()) {
                    throw new CheckedTestFrameworkException("INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP is unsupported " +
                                                            "in builds without JVMCI.");
                }
            }
            case CHECKCAST_ARRAYCOPY -> {
                if (Platform.isS390x()) {
                    throw new CheckedTestFrameworkException("CHECKCAST_ARRAYCOPY is unsupported on s390.");
                }
            }
            case IS_FINITE_D, IS_FINITE_F -> {
                if (!Platform.isRISCV64()) {
                    throw new CheckedTestFrameworkException("IS_FINITE_* is only supported on riscv64.");
                }
            }
            // default: do nothing -> IR node is supported and can be used by the user.
        }
    }

    /**
     * Get the regex of an IR node for a specific compile phase. If {@code irNode} is not an IR node placeholder string
     * or if there is no regex specified for {@code compilePhase}, a {@link TestFormatException} is reported.
     */
    public static String getRegexForCompilePhase(String irNode, CompilePhase compilePhase) {
        IRNodeMapEntry entry = IR_NODE_MAPPINGS.get(irNode);
        String failMsg = "IR Node \"" + irNode + "\" defined in class IRNode has no regex/compiler phase mapping " +
                         "(i.e. no static initializer block that adds a mapping entry to IRNode.IR_NODE_MAPPINGS)." +
                         System.lineSeparator() +
                         "   Have you just created the entry \"" + irNode + "\" in class IRNode and forgot to add a " +
                         "mapping?" + System.lineSeparator() +
                         "   Violation";
        TestFormat.checkNoReport(entry != null, failMsg);
        String regex = entry.regexForCompilePhase(compilePhase);
        failMsg = "IR Node \"" + irNode + "\" defined in class IRNode has no regex defined for compile phase "
                  + compilePhase + "." + System.lineSeparator() +
                  "   If you think this compile phase should be supported, update the mapping for \"" + irNode +
                  "\" in class IRNode (i.e the static initializer block immediately following the definition of \"" +
                  irNode + "\")." + System.lineSeparator() +
                  "   Violation";
        TestFormat.checkNoReport(regex != null, failMsg);
        return regex;
    }

    /**
     * Get the default phase of an IR node. If {@code irNode} is not an IR node placeholder string, a
     * {@link TestFormatException} is reported.
     */
    public static CompilePhase getDefaultPhase(String irNode) {
        IRNodeMapEntry entry = IR_NODE_MAPPINGS.get(irNode);
        String failMsg = "\"" + irNode + "\" is not an IR node defined in class IRNode and " +
                         "has therefore no default compile phase specified." + System.lineSeparator() +
                         "   If your regex represents a C2 IR node, consider adding an entry to class IRNode together " +
                         "with a static initializer block that adds a mapping to IRNode.IR_NODE_MAPPINGS." +
                         System.lineSeparator() +
                         "   Otherwise, set the @IR \"phase\" attribute to a compile phase different from " +
                         "CompilePhase.DEFAULT to explicitly tell the IR framework on which compile phase your rule" +
                         " should be applied on." + System.lineSeparator() +
                         "   Violation";
        TestFormat.checkNoReport(entry != null, failMsg);
        return entry.defaultCompilePhase();
    }

    public static String getVectorNodeType(String irNode) {
        String typeString = VECTOR_NODE_TYPE.get(irNode);
        String failMsg = "\"" + irNode + "\" is not a Vector IR node defined in class IRNode";
        TestFormat.check(typeString != null, failMsg);
        return typeString;
    }
}