1 /*
   2  * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package compiler.lib.ir_framework;
  25 
  26 import compiler.lib.ir_framework.driver.irmatching.mapping.*;
  27 import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo;
  28 import compiler.lib.ir_framework.shared.CheckedTestFrameworkException;
  29 import compiler.lib.ir_framework.shared.TestFormat;
  30 import compiler.lib.ir_framework.shared.TestFormatException;
  31 import compiler.valhalla.inlinetypes.InlineTypeIRNode;
  32 import jdk.test.lib.Platform;
  33 import jdk.test.whitebox.WhiteBox;
  34 
  35 import java.util.HashMap;
  36 import java.util.Map;
  37 
  38 /**
  39  * This class specifies IR node placeholder strings (also referred to as just "IR nodes") with mappings to regexes
  40  * depending on the selected compile phases. The mappings are stored in {@link #IR_NODE_MAPPINGS}. Each IR node
  41  * placeholder string is mapped to a {@link IRNodeMapEntry} instance defined in
  42  * {@link compiler.lib.ir_framework.driver.irmatching.mapping}.
  43  *
  44  * <p>
  45  * IR node placeholder strings can be used in {@link IR#failOn()} and/or {@link IR#counts()} attributes to define IR
  46  * constraints. They usually represent a single C2 IR node or a group of them.
  47  *
  48  * <p>
  49  * Each IR node placeholder string is accompanied by a static block that defines an IR node placeholder to regex(es)
  50  * mapping. The IR framework will automatically replace each IR node placeholder string in a user defined test with a
  51  * regex depending on the selected compile phases in {@link IR#phase} and the provided mapping.
  52  *
  53  * <p>
  54  * Each mapping must define a default compile phase which is applied when the user does not explicitly set the
  55  * {@link IR#phase()} attribute or when directly using {@link CompilePhase#DEFAULT}. In this case, the IR framework
  56  * falls back on the default compile phase of any {@link IRNodeMapEntry}.
  57  *
  58  * <p>
  59  * The IR framework reports a {@link TestFormatException} if:
  60  * <ul>
  61  *     <li><p> A user test specifies a compile phase for which no mapping is defined in this class.</li>
  62  *     <li><p> An IR node placeholder string is either missing a mapping or does not provide a regex for a specified
  63  *             compile phase in {@link IR#phase}.
  64  * </ul>
  65  *
  66  * <p>
  67  * There are two types of IR nodes:
  68  * <ul>
  69  *     <li><p>Normal IR nodes: The IR node placeholder string is directly replaced by a regex.</li>
  70  *     <li><p>Composite IR nodes:  The IR node placeholder string contains an additional {@link #COMPOSITE_PREFIX}.
  71  *                                 Using this IR node expects another user provided string in the constraint list of
  72  *                                 {@link IR#failOn()} and {@link IR#counts()}. They cannot be used as normal IR nodes.
  73  *                                 Trying to do so will result in a format violation error.</li>
  74  *     <li><p>Vector IR nodes:  The IR node placeholder string contains an additional {@link #VECTOR_PREFIX}.
  75  *                              Using this IR node, one can check for the type and size of a vector. The type must
  76  *                              be directly specified in {@link #vectorNode}. The size can be specified directly with
  77  *                              an additional argument using {@link #VECTOR_SIZE}, followed by a size tag or a comma
  78  *                              separated list of sizes. If the size argument is not given, then a default size of
  79  *                              {@link #VECTOR_SIZE_MAX} is taken, which is the number of elements that can fit in a
  80  *                              vector of the specified type (depends on the VM flag MaxVectorSize and CPU features).
  81  *                              However, when using {@link IR#failOn} or {@link IR#counts()} with comparison {@code <},
  82  *                              or {@code <=} or {@code =0}, the default size is {@link #VECTOR_SIZE_ANY}, allowing any
  83  *                              size. The motivation for these default values is that in most cases one wants to have
  84  *                              vectorization with maximal vector width, or no vectorization of any vector width.
  85  * </ul>
  86  */
  87 public class IRNode {
  88     /**
  89      * Prefix for normal IR nodes.
  90      */
  91     private static final String PREFIX = "_#";
  92     /**
  93      * Prefix for composite IR nodes.
  94      */
  95     private static final String COMPOSITE_PREFIX = PREFIX + "C#";
  96     /**
  97      * Prefix for vector IR nodes.
  98      */
  99     private static final String VECTOR_PREFIX = PREFIX + "V#";
 100 
 101     private static final String POSTFIX = "#_";
 102 
 103     private static final String START = "(\\d+(\\s){2}(";
 104     private static final String MID = ".*)+(\\s){2}===.*";
 105     private static final String END = ")";
 106     private static final String STORE_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END;
 107     private static final String LOAD_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END;
 108 
 109     public static final String IS_REPLACED = "#IS_REPLACED#"; // Is replaced by an additional user-defined string.
 110 
 111     public static final String VECTOR_SIZE = "_@";
 112     public static final String VECTOR_SIZE_TAG_ANY = "any";
 113     public static final String VECTOR_SIZE_TAG_MAX = "max_for_type";
 114     public static final String VECTOR_SIZE_ANY = VECTOR_SIZE + VECTOR_SIZE_TAG_ANY; // default for counts "=0" and failOn
 115     public static final String VECTOR_SIZE_MAX = VECTOR_SIZE + VECTOR_SIZE_TAG_MAX; // default in counts
 116     public static final String VECTOR_SIZE_2   = VECTOR_SIZE + "2";
 117     public static final String VECTOR_SIZE_4   = VECTOR_SIZE + "4";
 118     public static final String VECTOR_SIZE_8   = VECTOR_SIZE + "8";
 119     public static final String VECTOR_SIZE_16  = VECTOR_SIZE + "16";
 120     public static final String VECTOR_SIZE_32  = VECTOR_SIZE + "32";
 121     public static final String VECTOR_SIZE_64  = VECTOR_SIZE + "64";
 122 
 123     private static final String TYPE_BYTE   = "B";
 124     private static final String TYPE_CHAR   = "C";
 125     private static final String TYPE_SHORT  = "S";
 126     private static final String TYPE_INT    = "I";
 127     private static final String TYPE_LONG   = "J";
 128     private static final String TYPE_FLOAT  = "F";
 129     private static final String TYPE_DOUBLE = "D";
 130 
 131     /**
 132      * IR placeholder string to regex-for-compile-phase map.
 133      */
 134     private static final Map<String, IRNodeMapEntry> IR_NODE_MAPPINGS = new HashMap<>();
 135 
 136     /**
 137      * Map every vectorNode to a type string.
 138      */
 139     private static final Map<String, String> VECTOR_NODE_TYPE = new HashMap<>();
 140 
 141     /*
 142      * Start of IR placeholder string definitions followed by a static block defining the regex-for-compile-phase mapping.
 143      * An IR node placeholder string must start with PREFIX for normal IR nodes or COMPOSITE_PREFIX for composite IR
 144      * nodes, or VECTOR_PREFIX for vector nodes (see class description above).
 145      *
 146      * An IR node definition looks like this:
 147      *
 148      * public static final String IR_NODE = [PREFIX|COMPOSITE_PREFIX|VECTOR_PREFIX] + "IR_NODE" + POSTFIX;
 149      * static {
 150      *    // Define IR_NODE to regex-for-compile-phase mapping. Create a new IRNodeMapEntry object and add it to
 151      *    // IR_NODE_MAPPINGS. This can be done by using the helper methods defined after all IR node placeholder string
 152      *    // definitions.
 153      * }
 154      */
 155 
 156     // Valhalla: Make sure that all Valhalla specific IR nodes are also properly initialized. Doing it here also
 157     //           ensures that the Flag VM is able to pick up the correct compile phases.
 158     static {
 159         InlineTypeIRNode.forceStaticInitialization();
 160     }
 161 
 162     public static final String ABS_D = PREFIX + "ABS_D" + POSTFIX;
 163     static {
 164         beforeMatchingNameRegex(ABS_D, "AbsD");
 165     }
 166 
 167     public static final String ABS_F = PREFIX + "ABS_F" + POSTFIX;
 168     static {
 169         beforeMatchingNameRegex(ABS_F, "AbsF");
 170     }
 171 
 172     public static final String ABS_I = PREFIX + "ABS_I" + POSTFIX;
 173     static {
 174         beforeMatchingNameRegex(ABS_I, "AbsI");
 175     }
 176 
 177     public static final String ABS_L = PREFIX + "ABS_L" + POSTFIX;
 178     static {
 179         beforeMatchingNameRegex(ABS_L, "AbsL");
 180     }
 181 
 182     public static final String ABS_VB = VECTOR_PREFIX + "ABS_VB" + POSTFIX;
 183     static {
 184         vectorNode(ABS_VB, "AbsVB", TYPE_BYTE);
 185     }
 186 
 187     // ABS_VC / AbsVC does not exist (char is 2 byte unsigned)
 188 
 189     public static final String ABS_VS = VECTOR_PREFIX + "ABS_VS" + POSTFIX;
 190     static {
 191         vectorNode(ABS_VS, "AbsVS", TYPE_SHORT);
 192     }
 193 
 194     public static final String ABS_VI = VECTOR_PREFIX + "ABS_VI" + POSTFIX;
 195     static {
 196         vectorNode(ABS_VI, "AbsVI", TYPE_INT);
 197     }
 198 
 199     public static final String ABS_VL = VECTOR_PREFIX + "ABS_VL" + POSTFIX;
 200     static {
 201         vectorNode(ABS_VL, "AbsVL", TYPE_LONG);
 202     }
 203 
 204     public static final String ABS_VF = VECTOR_PREFIX + "ABS_VF" + POSTFIX;
 205     static {
 206         vectorNode(ABS_VF, "AbsVF", TYPE_FLOAT);
 207     }
 208 
 209     public static final String ABS_VD = VECTOR_PREFIX + "ABS_VD" + POSTFIX;
 210     static {
 211         vectorNode(ABS_VD, "AbsVD", TYPE_DOUBLE);
 212     }
 213 
 214     public static final String ADD = PREFIX + "ADD" + POSTFIX;
 215     static {
 216         beforeMatchingNameRegex(ADD, "Add(I|L|F|D|P)");
 217     }
 218 
 219     public static final String ADD_I = PREFIX + "ADD_I" + POSTFIX;
 220     static {
 221         beforeMatchingNameRegex(ADD_I, "AddI");
 222     }
 223 
 224     public static final String ADD_L = PREFIX + "ADD_L" + POSTFIX;
 225     static {
 226         beforeMatchingNameRegex(ADD_L, "AddL");
 227     }
 228 
 229     public static final String ADD_P = PREFIX + "ADD_P" + POSTFIX;
 230     static {
 231         beforeMatchingNameRegex(ADD_P, "AddP");
 232     }
 233 
 234     public static final String ADD_VD = VECTOR_PREFIX + "ADD_VD" + POSTFIX;
 235     static {
 236         vectorNode(ADD_VD, "AddVD", TYPE_DOUBLE);
 237     }
 238 
 239     public static final String ADD_VI = VECTOR_PREFIX + "ADD_VI" + POSTFIX;
 240     static {
 241         vectorNode(ADD_VI, "AddVI", TYPE_INT);
 242     }
 243 
 244     public static final String ADD_VF = VECTOR_PREFIX + "ADD_VF" + POSTFIX;
 245     static {
 246         vectorNode(ADD_VF, "AddVF", TYPE_FLOAT);
 247     }
 248 
 249     public static final String ADD_VB = VECTOR_PREFIX + "ADD_VB" + POSTFIX;
 250     static {
 251         vectorNode(ADD_VB, "AddVB", TYPE_BYTE);
 252     }
 253 
 254     public static final String ADD_VS = VECTOR_PREFIX + "ADD_VS" + POSTFIX;
 255     static {
 256         vectorNode(ADD_VS, "AddVS", TYPE_SHORT);
 257     }
 258 
 259     public static final String ADD_VL = VECTOR_PREFIX + "ADD_VL" + POSTFIX;
 260     static {
 261         vectorNode(ADD_VL, "AddVL", TYPE_LONG);
 262     }
 263 
 264     public static final String ADD_REDUCTION_V = PREFIX + "ADD_REDUCTION_V" + POSTFIX;
 265     static {
 266         beforeMatchingNameRegex(ADD_REDUCTION_V, "AddReductionV(B|S|I|L|F|D)");
 267     }
 268 
 269     public static final String ADD_REDUCTION_VD = PREFIX + "ADD_REDUCTION_VD" + POSTFIX;
 270     static {
 271         superWordNodes(ADD_REDUCTION_VD, "AddReductionVD");
 272     }
 273 
 274     public static final String ADD_REDUCTION_VF = PREFIX + "ADD_REDUCTION_VF" + POSTFIX;
 275     static {
 276         superWordNodes(ADD_REDUCTION_VF, "AddReductionVF");
 277     }
 278 
 279     public static final String ADD_REDUCTION_VI = PREFIX + "ADD_REDUCTION_VI" + POSTFIX;
 280     static {
 281         superWordNodes(ADD_REDUCTION_VI, "AddReductionVI");
 282     }
 283 
 284     public static final String ADD_REDUCTION_VL = PREFIX + "ADD_REDUCTION_VL" + POSTFIX;
 285     static {
 286         superWordNodes(ADD_REDUCTION_VL, "AddReductionVL");
 287     }
 288 
 289     public static final String ALLOC = PREFIX + "ALLOC" + POSTFIX;
 290     static {
 291         String optoRegex = "(.*precise .*\\R((.*(?i:mov|mv|xorl|nop|spill|pushq|popq).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_instance" + END;
 292         allocNodes(ALLOC, "Allocate", optoRegex);
 293     }
 294 
 295     public static final String ALLOC_OF = COMPOSITE_PREFIX + "ALLOC_OF" + POSTFIX;
 296     static {
 297         String regex = "(.*precise .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill|pushq|popq).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_instance" + END;
 298         optoOnly(ALLOC_OF, regex);
 299     }
 300 
 301     public static final String ALLOC_ARRAY = PREFIX + "ALLOC_ARRAY" + POSTFIX;
 302     static {
 303         String optoRegex = "(.*precise \\[.*\\R((.*(?i:mov|mv|xor|nop|spill|pushq|popq).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_array" + END;
 304         allocNodes(ALLOC_ARRAY, "AllocateArray", optoRegex);
 305     }
 306 
 307     public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "ALLOC_ARRAY_OF" + POSTFIX;
 308     static {
 309         String regex = "(.*precise \\[.*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill|pushq|popq).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_array" + END;
 310         optoOnly(ALLOC_ARRAY_OF, regex);
 311     }
 312 
 313     public static final String OR = PREFIX + "OR" + POSTFIX;
 314     static {
 315         beforeMatchingNameRegex(OR, "Or(I|L)");
 316     }
 317 
 318     public static final String AND = PREFIX + "AND" + POSTFIX;
 319     static {
 320         beforeMatchingNameRegex(AND, "And(I|L)");
 321     }
 322 
 323     public static final String AND_I = PREFIX + "AND_I" + POSTFIX;
 324     static {
 325         beforeMatchingNameRegex(AND_I, "AndI");
 326     }
 327 
 328     public static final String AND_L = PREFIX + "AND_L" + POSTFIX;
 329     static {
 330         beforeMatchingNameRegex(AND_L, "AndL");
 331     }
 332 
 333     public static final String AND_VB = VECTOR_PREFIX + "AND_VB" + POSTFIX;
 334     static {
 335         vectorNode(AND_VB, "AndV", TYPE_BYTE);
 336     }
 337 
 338     public static final String AND_VC = VECTOR_PREFIX + "AND_VC" + POSTFIX;
 339     static {
 340         vectorNode(AND_VC, "AndV", TYPE_CHAR);
 341     }
 342 
 343     public static final String AND_VS = VECTOR_PREFIX + "AND_VS" + POSTFIX;
 344     static {
 345         vectorNode(AND_VS, "AndV", TYPE_SHORT);
 346     }
 347 
 348     public static final String AND_VI = VECTOR_PREFIX + "AND_VI" + POSTFIX;
 349     static {
 350         vectorNode(AND_VI, "AndV", TYPE_INT);
 351     }
 352 
 353     public static final String AND_VL = VECTOR_PREFIX + "AND_VL" + POSTFIX;
 354     static {
 355         vectorNode(AND_VL, "AndV", TYPE_LONG);
 356     }
 357 
 358     public static final String AND_V_MASK = PREFIX + "AND_V_MASK" + POSTFIX;
 359     static {
 360         beforeMatchingNameRegex(AND_V_MASK, "AndVMask");
 361     }
 362 
 363     public static final String AND_REDUCTION_V = PREFIX + "AND_REDUCTION_V" + POSTFIX;
 364     static {
 365         superWordNodes(AND_REDUCTION_V, "AndReductionV");
 366     }
 367 
 368     public static final String CALL = PREFIX + "CALL" + POSTFIX;
 369     static {
 370         beforeMatchingNameRegex(CALL, "Call.*Java");
 371     }
 372 
 373     public static final String CALL_OF = COMPOSITE_PREFIX + "CALL_OF" + POSTFIX;
 374     static {
 375         callOfNodes(CALL_OF, "Call.*");
 376     }
 377 
 378     public static final String CALL_OF_METHOD = COMPOSITE_PREFIX + "CALL_OF_METHOD" + POSTFIX;
 379     static {
 380         callOfNodes(CALL_OF_METHOD, "Call.*Java");
 381     }
 382 
 383     public static final String STATIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "STATIC_CALL_OF_METHOD" + POSTFIX;
 384     static {
 385         callOfNodes(STATIC_CALL_OF_METHOD, "CallStaticJava");
 386     }
 387 
 388     public static final String CAST_II = PREFIX + "CAST_II" + POSTFIX;
 389     static {
 390         beforeMatchingNameRegex(CAST_II, "CastII");
 391     }
 392 
 393     public static final String CAST_LL = PREFIX + "CAST_LL" + POSTFIX;
 394     static {
 395         beforeMatchingNameRegex(CAST_LL, "CastLL");
 396     }
 397 
 398     public static final String CBNZW_HI = PREFIX + "CBNZW_HI" + POSTFIX;
 399     static {
 400         optoOnly(CBNZW_HI, "cbwhi");
 401     }
 402 
 403     public static final String CBZW_LS = PREFIX + "CBZW_LS" + POSTFIX;
 404     static {
 405         optoOnly(CBZW_LS, "cbwls");
 406     }
 407 
 408     public static final String CBZ_LS = PREFIX + "CBZ_LS" + POSTFIX;
 409     static {
 410         optoOnly(CBZ_LS, "cbls");
 411     }
 412 
 413     public static final String CBZ_HI = PREFIX + "CBZ_HI" + POSTFIX;
 414     static {
 415         optoOnly(CBZ_HI, "cbhi");
 416     }
 417 
 418     public static final String CHECKCAST_ARRAY = PREFIX + "CHECKCAST_ARRAY" + POSTFIX;
 419     static {
 420         String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*:|.*(?i:mov|mv|or).*precise \\[.*:.*\\R.*(cmp|CMP|CLR))" + END;
 421         optoOnly(CHECKCAST_ARRAY, regex);
 422     }
 423 
 424     public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "CHECKCAST_ARRAY_OF" + POSTFIX;
 425     static {
 426         String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*" + IS_REPLACED + ":|.*(?i:mov|mv|or).*precise \\[.*" + IS_REPLACED + ":.*\\R.*(cmp|CMP|CLR))" + END;
 427         optoOnly(CHECKCAST_ARRAY_OF, regex);
 428     }
 429 
 430     // Does not work on s390 (a rule containing this regex will be skipped on s390).
 431     public static final String CHECKCAST_ARRAYCOPY = PREFIX + "CHECKCAST_ARRAYCOPY" + POSTFIX;
 432     static {
 433         String regex = "(.*((?i:call_leaf_nofp,runtime)|CALL,\\s?runtime leaf nofp|BCTRL.*.leaf call).*checkcast_arraycopy.*" + END;
 434         optoOnly(CHECKCAST_ARRAYCOPY, regex);
 435     }
 436 
 437     public static final String CLASS_CHECK_TRAP = PREFIX + "CLASS_CHECK_TRAP" + POSTFIX;
 438     static {
 439         trapNodes(CLASS_CHECK_TRAP, "class_check");
 440     }
 441 
 442     public static final String CMOVE_I = PREFIX + "CMOVE_I" + POSTFIX;
 443     static {
 444         beforeMatchingNameRegex(CMOVE_I, "CMoveI");
 445     }
 446 
 447     public static final String CMP_I = PREFIX + "CMP_I" + POSTFIX;
 448     static {
 449         beforeMatchingNameRegex(CMP_I, "CmpI");
 450     }
 451 
 452     public static final String CMP_L = PREFIX + "CMP_L" + POSTFIX;
 453     static {
 454         beforeMatchingNameRegex(CMP_L, "CmpL");
 455     }
 456 
 457     public static final String CMP_U = PREFIX + "CMP_U" + POSTFIX;
 458     static {
 459         beforeMatchingNameRegex(CMP_U, "CmpU\\b");
 460     }
 461 
 462     public static final String CMP_U3 = PREFIX + "CMP_U3" + POSTFIX;
 463     static {
 464         beforeMatchingNameRegex(CMP_U3, "CmpU3");
 465     }
 466 
 467     public static final String CMP_UL = PREFIX + "CMP_UL" + POSTFIX;
 468     static {
 469         beforeMatchingNameRegex(CMP_UL, "CmpUL");
 470     }
 471 
 472     public static final String CMP_UL3 = PREFIX + "CMP_UL3" + POSTFIX;
 473     static {
 474         beforeMatchingNameRegex(CMP_UL3, "CmpUL3");
 475     }
 476 
 477     public static final String CMP_P = PREFIX + "CMP_P" + POSTFIX;
 478     static {
 479         beforeMatchingNameRegex(CMP_P, "CmpP");
 480     }
 481 
 482     public static final String COMPRESS_BITS = PREFIX + "COMPRESS_BITS" + POSTFIX;
 483     static {
 484         beforeMatchingNameRegex(COMPRESS_BITS, "CompressBits");
 485     }
 486 
 487     public static final String CONV = PREFIX + "CONV" + POSTFIX;
 488     static {
 489         beforeMatchingNameRegex(CONV, "Conv");
 490     }
 491 
 492     public static final String CONV_I2L = PREFIX + "CONV_I2L" + POSTFIX;
 493     static {
 494         beforeMatchingNameRegex(CONV_I2L, "ConvI2L");
 495     }
 496 
 497     public static final String CONV_L2I = PREFIX + "CONV_L2I" + POSTFIX;
 498     static {
 499         beforeMatchingNameRegex(CONV_L2I, "ConvL2I");
 500     }
 501 
 502     public static final String CON_I = PREFIX + "CON_I" + POSTFIX;
 503     static {
 504         beforeMatchingNameRegex(CON_I, "ConI");
 505     }
 506 
 507     public static final String CON_L = PREFIX + "CON_L" + POSTFIX;
 508     static {
 509         beforeMatchingNameRegex(CON_L, "ConL");
 510     }
 511 
 512     public static final String COUNTED_LOOP = PREFIX + "COUNTED_LOOP" + POSTFIX;
 513     static {
 514         String regex = START + "CountedLoop\\b" + MID + END;
 515         fromAfterCountedLoops(COUNTED_LOOP, regex);
 516     }
 517 
 518     public static final String COUNTED_LOOP_MAIN = PREFIX + "COUNTED_LOOP_MAIN" + POSTFIX;
 519     static {
 520         String regex = START + "CountedLoop\\b" + MID + "main" + END;
 521         fromAfterCountedLoops(COUNTED_LOOP_MAIN, regex);
 522     }
 523 
 524     public static final String DIV = PREFIX + "DIV" + POSTFIX;
 525     static {
 526         beforeMatchingNameRegex(DIV, "Div(I|L|F|D)");
 527     }
 528 
 529     public static final String DIV_BY_ZERO_TRAP = PREFIX + "DIV_BY_ZERO_TRAP" + POSTFIX;
 530     static {
 531         trapNodes(DIV_BY_ZERO_TRAP, "div0_check");
 532     }
 533 
 534     public static final String DIV_I = PREFIX + "DIV_I" + POSTFIX;
 535     static {
 536         beforeMatchingNameRegex(DIV_I, "DivI");
 537     }
 538 
 539     public static final String DIV_L = PREFIX + "DIV_L" + POSTFIX;
 540     static {
 541         beforeMatchingNameRegex(DIV_L, "DivL");
 542     }
 543 
 544     public static final String DIV_MOD_I = PREFIX + "DIV_MOD_I" + POSTFIX;
 545     static {
 546         beforeMatchingNameRegex(DIV_MOD_I, "DivModI");
 547     }
 548 
 549     public static final String DIV_MOD_L = PREFIX + "DIV_MOD_L" + POSTFIX;
 550     static {
 551         beforeMatchingNameRegex(DIV_MOD_L, "DivModL");
 552     }
 553 
 554     public static final String DIV_VF = VECTOR_PREFIX + "DIV_VF" + POSTFIX;
 555     static {
 556         vectorNode(DIV_VF, "DivVF", TYPE_FLOAT);
 557     }
 558 
 559     public static final String DIV_VD = VECTOR_PREFIX + "DIV_VD" + POSTFIX;
 560     static {
 561         vectorNode(DIV_VD, "DivVD", TYPE_DOUBLE);
 562     }
 563 
 564     public static final String DYNAMIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "DYNAMIC_CALL_OF_METHOD" + POSTFIX;
 565     static {
 566         callOfNodes(DYNAMIC_CALL_OF_METHOD, "CallDynamicJava");
 567     }
 568 
 569     public static final String EXPAND_BITS = PREFIX + "EXPAND_BITS" + POSTFIX;
 570     static {
 571         beforeMatchingNameRegex(EXPAND_BITS, "ExpandBits");
 572     }
 573 
 574     public static final String FAST_LOCK = PREFIX + "FAST_LOCK" + POSTFIX;
 575     static {
 576         beforeMatchingNameRegex(FAST_LOCK, "FastLock");
 577     }
 578 
 579     public static final String FAST_UNLOCK = PREFIX + "FAST_UNLOCK" + POSTFIX;
 580     static {
 581         String regex = START + "FastUnlock" + MID + END;
 582         fromMacroToBeforeMatching(FAST_UNLOCK, regex);
 583     }
 584 
 585     public static final String FIELD_ACCESS = PREFIX + "FIELD_ACCESS" + POSTFIX;
 586     static {
 587         String regex = "(.*Field: *" + END;
 588         optoOnly(FIELD_ACCESS, regex);
 589     }
 590 
 591     public static final String FMA_VF = VECTOR_PREFIX + "FMA_VF" + POSTFIX;
 592     static {
 593         vectorNode(FMA_VF, "FmaVF", TYPE_FLOAT);
 594     }
 595 
 596     public static final String FMA_VD = VECTOR_PREFIX + "FMA_VD" + POSTFIX;
 597     static {
 598         vectorNode(FMA_VD, "FmaVD", TYPE_DOUBLE);
 599     }
 600 
 601     public static final String G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG" + POSTFIX;
 602     static {
 603         String regex = START + "g1CompareAndExchangeN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 604         machOnly(G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG, regex);
 605     }
 606 
 607     public static final String G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG" + POSTFIX;
 608     static {
 609         String regex = START + "g1CompareAndExchangeP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 610         machOnly(G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG, regex);
 611     }
 612 
 613     public static final String G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG" + POSTFIX;
 614     static {
 615         String regex = START + "g1CompareAndSwapN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 616         machOnly(G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG, regex);
 617     }
 618 
 619     public static final String G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG" + POSTFIX;
 620     static {
 621         String regex = START + "g1CompareAndSwapP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 622         machOnly(G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, regex);
 623     }
 624 
 625     public static final String G1_ENCODE_P_AND_STORE_N = PREFIX + "G1_ENCODE_P_AND_STORE_N" + POSTFIX;
 626     static {
 627         machOnlyNameRegex(G1_ENCODE_P_AND_STORE_N, "g1EncodePAndStoreN");
 628     }
 629 
 630     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;
 631     static {
 632         String regex = START + "g1EncodePAndStoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 633         machOnly(G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, regex);
 634     }
 635 
 636     public static final String G1_GET_AND_SET_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_N_WITH_BARRIER_FLAG" + POSTFIX;
 637     static {
 638         String regex = START + "g1GetAndSetN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 639         machOnly(G1_GET_AND_SET_N_WITH_BARRIER_FLAG, regex);
 640     }
 641 
 642     public static final String G1_GET_AND_SET_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_P_WITH_BARRIER_FLAG" + POSTFIX;
 643     static {
 644         String regex = START + "g1GetAndSetP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 645         machOnly(G1_GET_AND_SET_P_WITH_BARRIER_FLAG, regex);
 646     }
 647 
 648     public static final String G1_LOAD_N = PREFIX + "G1_LOAD_N" + POSTFIX;
 649     static {
 650         machOnlyNameRegex(G1_LOAD_N, "g1LoadN");
 651     }
 652 
 653     public static final String G1_LOAD_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_N_WITH_BARRIER_FLAG" + POSTFIX;
 654     static {
 655         String regex = START + "g1LoadN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 656         machOnly(G1_LOAD_N_WITH_BARRIER_FLAG, regex);
 657     }
 658 
 659     public static final String G1_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX;
 660     static {
 661         String regex = START + "g1LoadP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 662         machOnly(G1_LOAD_P_WITH_BARRIER_FLAG, regex);
 663     }
 664 
 665     public static final String G1_STORE_N = PREFIX + "G1_STORE_N" + POSTFIX;
 666     static {
 667         machOnlyNameRegex(G1_STORE_N, "g1StoreN");
 668     }
 669 
 670     public static final String G1_STORE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_N_WITH_BARRIER_FLAG" + POSTFIX;
 671     static {
 672         String regex = START + "g1StoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 673         machOnly(G1_STORE_N_WITH_BARRIER_FLAG, regex);
 674     }
 675 
 676     public static final String G1_STORE_P = PREFIX + "G1_STORE_P" + POSTFIX;
 677     static {
 678         machOnlyNameRegex(G1_STORE_P, "g1StoreP");
 679     }
 680 
 681     public static final String G1_STORE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_P_WITH_BARRIER_FLAG" + POSTFIX;
 682     static {
 683         String regex = START + "g1StoreP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 684         machOnly(G1_STORE_P_WITH_BARRIER_FLAG, regex);
 685     }
 686 
 687     public static final String IF = PREFIX + "IF" + POSTFIX;
 688     static {
 689         beforeMatchingNameRegex(IF, "If\\b");
 690     }
 691 
 692     public static final String INLINE_TYPE = PREFIX + "INLINE_TYPE" + POSTFIX;
 693     static {
 694         beforeMatchingNameRegex(INLINE_TYPE, "InlineType");
 695     }
 696 
 697     // Does not work for VM builds without JVMCI like x86_32 (a rule containing this regex will be skipped without having JVMCI built).
 698     public static final String INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP = PREFIX + "INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP" + POSTFIX;
 699     static {
 700         trapNodes(INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP, "intrinsic_or_type_checked_inlining");
 701     }
 702 
 703     public static final String INTRINSIC_TRAP = PREFIX + "INTRINSIC_TRAP" + POSTFIX;
 704     static {
 705         trapNodes(INTRINSIC_TRAP, "intrinsic");
 706     }
 707 
 708     // Is only supported on riscv64.
 709     public static final String IS_FINITE_D = PREFIX + "IS_FINITE_D" + POSTFIX;
 710     static {
 711         beforeMatchingNameRegex(IS_FINITE_D, "IsFiniteD");
 712     }
 713 
 714     // Is only supported on riscv64.
 715     public static final String IS_FINITE_F = PREFIX + "IS_FINITE_F" + POSTFIX;
 716     static {
 717         beforeMatchingNameRegex(IS_FINITE_F, "IsFiniteF");
 718     }
 719 
 720     public static final String IS_INFINITE_D = PREFIX + "IS_INFINITE_D" + POSTFIX;
 721     static {
 722         beforeMatchingNameRegex(IS_INFINITE_D, "IsInfiniteD");
 723     }
 724 
 725     public static final String IS_INFINITE_F = PREFIX + "IS_INFINITE_F" + POSTFIX;
 726     static {
 727         beforeMatchingNameRegex(IS_INFINITE_F, "IsInfiniteF");
 728     }
 729 
 730     public static final String LOAD = PREFIX + "LOAD" + POSTFIX;
 731     static {
 732         beforeMatchingNameRegex(LOAD, "Load(B|UB|S|US|I|L|F|D|P|N)");
 733     }
 734 
 735     public static final String LOAD_OF_CLASS = COMPOSITE_PREFIX + "LOAD_OF_CLASS" + POSTFIX;
 736     static {
 737         loadOfNodes(LOAD_OF_CLASS, "Load(B|UB|S|US|I|L|F|D|P|N)");
 738     }
 739 
 740     public static final String LOAD_B = PREFIX + "LOAD_B" + POSTFIX;
 741     static {
 742         beforeMatchingNameRegex(LOAD_B, "LoadB");
 743     }
 744 
 745     public static final String LOAD_B_OF_CLASS = COMPOSITE_PREFIX + "LOAD_B_OF_CLASS" + POSTFIX;
 746     static {
 747         loadOfNodes(LOAD_B_OF_CLASS, "LoadB");
 748     }
 749 
 750     public static final String LOAD_D = PREFIX + "LOAD_D" + POSTFIX;
 751     static {
 752         beforeMatchingNameRegex(LOAD_D, "LoadD");
 753     }
 754 
 755     public static final String LOAD_D_OF_CLASS = COMPOSITE_PREFIX + "LOAD_D_OF_CLASS" + POSTFIX;
 756     static {
 757         loadOfNodes(LOAD_D_OF_CLASS, "LoadD");
 758     }
 759 
 760     public static final String LOAD_F = PREFIX + "LOAD_F" + POSTFIX;
 761     static {
 762         beforeMatchingNameRegex(LOAD_F, "LoadF");
 763     }
 764 
 765     public static final String LOAD_F_OF_CLASS = COMPOSITE_PREFIX + "LOAD_F_OF_CLASS" + POSTFIX;
 766     static {
 767         loadOfNodes(LOAD_F_OF_CLASS, "LoadF");
 768     }
 769 
 770     public static final String LOAD_I = PREFIX + "LOAD_I" + POSTFIX;
 771     static {
 772         beforeMatchingNameRegex(LOAD_I, "LoadI");
 773     }
 774 
 775     public static final String LOAD_I_OF_CLASS = COMPOSITE_PREFIX + "LOAD_I_OF_CLASS" + POSTFIX;
 776     static {
 777         loadOfNodes(LOAD_I_OF_CLASS, "LoadI");
 778     }
 779 
 780     public static final String LOAD_KLASS = PREFIX + "LOAD_KLASS" + POSTFIX;
 781     static {
 782         beforeMatchingNameRegex(LOAD_KLASS, "LoadKlass");
 783     }
 784 
 785     public static final String LOAD_NKLASS = PREFIX + "LOAD_NKLASS" + POSTFIX;
 786     static {
 787         beforeMatchingNameRegex(LOAD_NKLASS, "LoadNKlass");
 788     }
 789 
 790     public static final String LOAD_KLASS_OR_NKLASS = PREFIX + "LOAD_KLASS_OR_NKLASS" + POSTFIX;
 791     static {
 792         beforeMatchingNameRegex(LOAD_KLASS_OR_NKLASS, "LoadN?Klass");
 793     }
 794 
 795     public static final String LOAD_L = PREFIX + "LOAD_L" + POSTFIX;
 796     static {
 797         beforeMatchingNameRegex(LOAD_L, "LoadL");
 798     }
 799 
 800     public static final String LOAD_L_OF_CLASS = COMPOSITE_PREFIX + "LOAD_L_OF_CLASS" + POSTFIX;
 801     static {
 802         loadOfNodes(LOAD_L_OF_CLASS, "LoadL");
 803     }
 804 
 805     public static final String LOAD_N = PREFIX + "LOAD_N" + POSTFIX;
 806     static {
 807         beforeMatchingNameRegex(LOAD_N, "LoadN");
 808     }
 809 
 810     public static final String LOAD_N_OF_CLASS = COMPOSITE_PREFIX + "LOAD_N_OF_CLASS" + POSTFIX;
 811     static {
 812         loadOfNodes(LOAD_N_OF_CLASS, "LoadN");
 813     }
 814 
 815     public static final String LOAD_OF_FIELD = COMPOSITE_PREFIX + "LOAD_OF_FIELD" + POSTFIX;
 816     static {
 817         String regex = START + "Load(B|C|S|I|L|F|D|P|N)" + MID + "@.*name=" + IS_REPLACED + ",.*" + END;
 818         beforeMatching(LOAD_OF_FIELD, regex);
 819     }
 820 
 821     public static final String LOAD_P = PREFIX + "LOAD_P" + POSTFIX;
 822     static {
 823         beforeMatchingNameRegex(LOAD_P, "LoadP");
 824     }
 825 
 826     public static final String LOAD_P_OF_CLASS = COMPOSITE_PREFIX + "LOAD_P_OF_CLASS" + POSTFIX;
 827     static {
 828         loadOfNodes(LOAD_P_OF_CLASS, "LoadP");
 829     }
 830 
 831     public static final String LOAD_S = PREFIX + "LOAD_S" + POSTFIX;
 832     static {
 833         beforeMatchingNameRegex(LOAD_S, "LoadS");
 834     }
 835 
 836     public static final String LOAD_S_OF_CLASS = COMPOSITE_PREFIX + "LOAD_S_OF_CLASS" + POSTFIX;
 837     static {
 838         loadOfNodes(LOAD_S_OF_CLASS, "LoadS");
 839     }
 840 
 841     public static final String LOAD_UB = PREFIX + "LOAD_UB" + POSTFIX;
 842     static {
 843         beforeMatchingNameRegex(LOAD_UB, "LoadUB");
 844     }
 845 
 846     public static final String LOAD_UB_OF_CLASS = COMPOSITE_PREFIX + "LOAD_UB_OF_CLASS" + POSTFIX;
 847     static {
 848         loadOfNodes(LOAD_UB_OF_CLASS, "LoadUB");
 849     }
 850 
 851     public static final String LOAD_US = PREFIX + "LOAD_US" + POSTFIX;
 852     static {
 853         beforeMatchingNameRegex(LOAD_US, "LoadUS");
 854     }
 855 
 856     public static final String LOAD_US_OF_CLASS = COMPOSITE_PREFIX + "LOAD_US_OF_CLASS" + POSTFIX;
 857     static {
 858         loadOfNodes(LOAD_US_OF_CLASS, "LoadUS");
 859     }
 860 
 861     public static final String LOAD_VECTOR_B = VECTOR_PREFIX + "LOAD_VECTOR_B" + POSTFIX;
 862     static {
 863         vectorNode(LOAD_VECTOR_B, "LoadVector", TYPE_BYTE);
 864     }
 865 
 866     public static final String LOAD_VECTOR_C = VECTOR_PREFIX + "LOAD_VECTOR_C" + POSTFIX;
 867     static {
 868         vectorNode(LOAD_VECTOR_C, "LoadVector", TYPE_CHAR);
 869     }
 870 
 871     public static final String LOAD_VECTOR_S = VECTOR_PREFIX + "LOAD_VECTOR_S" + POSTFIX;
 872     static {
 873         vectorNode(LOAD_VECTOR_S, "LoadVector", TYPE_SHORT);
 874     }
 875 
 876     public static final String LOAD_VECTOR_I = VECTOR_PREFIX + "LOAD_VECTOR_I" + POSTFIX;
 877     static {
 878         vectorNode(LOAD_VECTOR_I, "LoadVector", TYPE_INT);
 879     }
 880 
 881     public static final String LOAD_VECTOR_L = VECTOR_PREFIX + "LOAD_VECTOR_L" + POSTFIX;
 882     static {
 883         vectorNode(LOAD_VECTOR_L, "LoadVector", TYPE_LONG);
 884     }
 885 
 886     public static final String LOAD_VECTOR_F = VECTOR_PREFIX + "LOAD_VECTOR_F" + POSTFIX;
 887     static {
 888         vectorNode(LOAD_VECTOR_F, "LoadVector", TYPE_FLOAT);
 889     }
 890 
 891     public static final String LOAD_VECTOR_D = VECTOR_PREFIX + "LOAD_VECTOR_D" + POSTFIX;
 892     static {
 893         vectorNode(LOAD_VECTOR_D, "LoadVector", TYPE_DOUBLE);
 894     }
 895 
 896     public static final String LOAD_VECTOR_GATHER = PREFIX + "LOAD_VECTOR_GATHER" + POSTFIX;
 897     static {
 898         beforeMatchingNameRegex(LOAD_VECTOR_GATHER, "LoadVectorGather");
 899     }
 900 
 901     public static final String LOAD_VECTOR_MASKED = PREFIX + "LOAD_VECTOR_MASKED" + POSTFIX;
 902     static {
 903         beforeMatchingNameRegex(LOAD_VECTOR_MASKED, "LoadVectorMasked");
 904     }
 905 
 906     public static final String LOAD_VECTOR_GATHER_MASKED = PREFIX + "LOAD_VECTOR_GATHER_MASKED" + POSTFIX;
 907     static {
 908         beforeMatchingNameRegex(LOAD_VECTOR_GATHER_MASKED, "LoadVectorGatherMasked");
 909     }
 910 
 911     public static final String LONG_COUNTED_LOOP = PREFIX + "LONG_COUNTED_LOOP" + POSTFIX;
 912     static {
 913         String regex = START + "LongCountedLoop\\b" + MID + END;
 914         fromAfterCountedLoops(LONG_COUNTED_LOOP, regex);
 915     }
 916 
 917     public static final String LOOP = PREFIX + "LOOP" + POSTFIX;
 918     static {
 919         String regex = START + "Loop" + MID + END;
 920         fromBeforeCountedLoops(LOOP, regex);
 921     }
 922 
 923     public static final String LSHIFT = PREFIX + "LSHIFT" + POSTFIX;
 924     static {
 925         beforeMatchingNameRegex(LSHIFT, "LShift(I|L)");
 926     }
 927 
 928     public static final String LSHIFT_I = PREFIX + "LSHIFT_I" + POSTFIX;
 929     static {
 930         beforeMatchingNameRegex(LSHIFT_I, "LShiftI");
 931     }
 932 
 933     public static final String LSHIFT_L = PREFIX + "LSHIFT_L" + POSTFIX;
 934     static {
 935         beforeMatchingNameRegex(LSHIFT_L, "LShiftL");
 936     }
 937 
 938     public static final String LSHIFT_VB = VECTOR_PREFIX + "LSHIFT_VB" + POSTFIX;
 939     static {
 940         vectorNode(LSHIFT_VB, "LShiftVB", TYPE_BYTE);
 941     }
 942 
 943     public static final String LSHIFT_VS = VECTOR_PREFIX + "LSHIFT_VS" + POSTFIX;
 944     static {
 945         vectorNode(LSHIFT_VS, "LShiftVS", TYPE_SHORT);
 946     }
 947 
 948     public static final String LSHIFT_VC = VECTOR_PREFIX + "LSHIFT_VC" + POSTFIX;
 949     static {
 950         vectorNode(LSHIFT_VC, "LShiftVS", TYPE_CHAR); // using short op with char type
 951     }
 952 
 953     public static final String LSHIFT_VI = VECTOR_PREFIX + "LSHIFT_VI" + POSTFIX;
 954     static {
 955         vectorNode(LSHIFT_VI, "LShiftVI", TYPE_INT);
 956     }
 957 
 958     public static final String LSHIFT_VL = VECTOR_PREFIX + "LSHIFT_VL" + POSTFIX;
 959     static {
 960         vectorNode(LSHIFT_VL, "LShiftVL", TYPE_LONG);
 961     }
 962 
 963     public static final String MACH_TEMP = PREFIX + "MACH_TEMP" + POSTFIX;
 964     static {
 965         machOnlyNameRegex(MACH_TEMP, "MachTemp");
 966     }
 967 
 968     public static final String MACRO_LOGIC_V = PREFIX + "MACRO_LOGIC_V" + POSTFIX;
 969     static {
 970         afterBarrierExpansionToBeforeMatching(MACRO_LOGIC_V, "MacroLogicV");
 971     }
 972 
 973     public static final String MAX = PREFIX + "MAX" + POSTFIX;
 974     static {
 975         beforeMatchingNameRegex(MAX, "Max(I|L|F|D)");
 976     }
 977 
 978     public static final String MAX_D = PREFIX + "MAX_D" + POSTFIX;
 979     static {
 980         beforeMatchingNameRegex(MAX_D, "MaxD");
 981     }
 982 
 983     public static final String MAX_D_REDUCTION_REG = PREFIX + "MAX_D_REDUCTION_REG" + POSTFIX;
 984     static {
 985         machOnlyNameRegex(MAX_D_REDUCTION_REG, "maxD_reduction_reg");
 986     }
 987 
 988     public static final String MAX_D_REG = PREFIX + "MAX_D_REG" + POSTFIX;
 989     static {
 990         machOnlyNameRegex(MAX_D_REG, "maxD_reg");
 991     }
 992 
 993     public static final String MAX_F = PREFIX + "MAX_F" + POSTFIX;
 994     static {
 995         beforeMatchingNameRegex(MAX_F, "MaxF");
 996     }
 997 
 998     public static final String MAX_F_REDUCTION_REG = PREFIX + "MAX_F_REDUCTION_REG" + POSTFIX;
 999     static {
1000         machOnlyNameRegex(MAX_F_REDUCTION_REG, "maxF_reduction_reg");
1001     }
1002 
1003     public static final String MAX_F_REG = PREFIX + "MAX_F_REG" + POSTFIX;
1004     static {
1005         machOnlyNameRegex(MAX_F_REG, "maxF_reg");
1006     }
1007 
1008     public static final String MAX_I = PREFIX + "MAX_I" + POSTFIX;
1009     static {
1010         beforeMatchingNameRegex(MAX_I, "MaxI");
1011     }
1012 
1013     public static final String MAX_L = PREFIX + "MAX_L" + POSTFIX;
1014     static {
1015         beforeMatchingNameRegex(MAX_L, "MaxL");
1016     }
1017 
1018     public static final String MAX_VI = VECTOR_PREFIX + "MAX_VI" + POSTFIX;
1019     static {
1020         vectorNode(MAX_VI, "MaxV", TYPE_INT);
1021     }
1022 
1023     public static final String MAX_VF = VECTOR_PREFIX + "MAX_VF" + POSTFIX;
1024     static {
1025         vectorNode(MAX_VF, "MaxV", TYPE_FLOAT);
1026     }
1027 
1028     public static final String MAX_VD = VECTOR_PREFIX + "MAX_VD" + POSTFIX;
1029     static {
1030         vectorNode(MAX_VD, "MaxV", TYPE_DOUBLE);
1031     }
1032 
1033     public static final String MAX_VL = VECTOR_PREFIX + "MAX_VL" + POSTFIX;
1034     static {
1035         vectorNode(MAX_VL, "MaxV", TYPE_LONG);
1036     }
1037 
1038     public static final String MEMBAR = PREFIX + "MEMBAR" + POSTFIX;
1039     static {
1040         beforeMatchingNameRegex(MEMBAR, "MemBar");
1041     }
1042 
1043     public static final String MEMBAR_ACQUIRE = PREFIX + "MEMBAR_ACQUIRE" + POSTFIX;
1044     static {
1045         beforeMatchingNameRegex(MEMBAR_ACQUIRE, "MemBarAcquire");
1046     }
1047 
1048     public static final String MEMBAR_RELEASE = PREFIX + "MEMBAR_RELEASE" + POSTFIX;
1049     static {
1050         beforeMatchingNameRegex(MEMBAR_RELEASE, "MemBarRelease");
1051     }
1052 
1053     public static final String MEMBAR_STORESTORE = PREFIX + "MEMBAR_STORESTORE" + POSTFIX;
1054     static {
1055         beforeMatchingNameRegex(MEMBAR_STORESTORE, "MemBarStoreStore");
1056     }
1057 
1058     public static final String MEMBAR_VOLATILE = PREFIX + "MEMBAR_VOLATILE" + POSTFIX;
1059     static {
1060         beforeMatchingNameRegex(MEMBAR_VOLATILE, "MemBarVolatile");
1061     }
1062 
1063     public static final String MIN = PREFIX + "MIN" + POSTFIX;
1064     static {
1065         beforeMatchingNameRegex(MIN, "Min(I|L)");
1066     }
1067 
1068     public static final String MIN_D = PREFIX + "MIN_D" + POSTFIX;
1069     static {
1070         beforeMatchingNameRegex(MIN_D, "MinD");
1071     }
1072 
1073     public static final String MIN_D_REDUCTION_REG = PREFIX + "MIN_D_REDUCTION_REG" + POSTFIX;
1074     static {
1075         machOnlyNameRegex(MIN_D_REDUCTION_REG, "minD_reduction_reg");
1076     }
1077 
1078     public static final String MIN_D_REG = PREFIX + "MIN_D_REG" + POSTFIX;
1079     static {
1080         machOnlyNameRegex(MIN_D_REG, "minD_reg");
1081     }
1082 
1083     public static final String MIN_F = PREFIX + "MIN_F" + POSTFIX;
1084     static {
1085         beforeMatchingNameRegex(MIN_F, "MinF");
1086     }
1087 
1088     public static final String MIN_F_REDUCTION_REG = PREFIX + "MIN_F_REDUCTION_REG" + POSTFIX;
1089     static {
1090         machOnlyNameRegex(MIN_F_REDUCTION_REG, "minF_reduction_reg");
1091     }
1092 
1093     public static final String MIN_F_REG = PREFIX + "MIN_F_REG" + POSTFIX;
1094     static {
1095         machOnlyNameRegex(MIN_F_REG, "minF_reg");
1096     }
1097 
1098     public static final String MIN_I = PREFIX + "MIN_I" + POSTFIX;
1099     static {
1100         beforeMatchingNameRegex(MIN_I, "MinI");
1101     }
1102 
1103     public static final String MIN_L = PREFIX + "MIN_L" + POSTFIX;
1104     static {
1105         beforeMatchingNameRegex(MIN_L, "MinL");
1106     }
1107 
1108     public static final String MIN_VI = VECTOR_PREFIX + "MIN_VI" + POSTFIX;
1109     static {
1110         vectorNode(MIN_VI, "MinV", TYPE_INT);
1111     }
1112 
1113     public static final String MIN_VF = VECTOR_PREFIX + "MIN_VF" + POSTFIX;
1114     static {
1115         vectorNode(MIN_VF, "MinV", TYPE_FLOAT);
1116     }
1117 
1118     public static final String MIN_VD = VECTOR_PREFIX + "MIN_VD" + POSTFIX;
1119     static {
1120         vectorNode(MIN_VD, "MinV", TYPE_DOUBLE);
1121     }
1122 
1123     public static final String MIN_VL = VECTOR_PREFIX + "MIN_VL" + POSTFIX;
1124     static {
1125         vectorNode(MIN_VL, "MinV", TYPE_LONG);
1126     }
1127 
1128     public static final String MOD_I = PREFIX + "MOD_I" + POSTFIX;
1129     static {
1130         beforeMatchingNameRegex(MOD_I, "ModI");
1131     }
1132 
1133     public static final String MOD_L = PREFIX + "MOD_L" + POSTFIX;
1134     static {
1135         beforeMatchingNameRegex(MOD_L, "ModL");
1136     }
1137 
1138     public static final String MUL = PREFIX + "MUL" + POSTFIX;
1139     static {
1140         beforeMatchingNameRegex(MUL, "Mul(I|L|F|D)");
1141     }
1142 
1143     public static final String MUL_ADD_S2I = PREFIX + "MUL_ADD_S2I" + POSTFIX;
1144     static {
1145         beforeMatchingNameRegex(MUL_ADD_S2I, "MulAddS2I");
1146     }
1147 
1148     public static final String MUL_ADD_VS2VI = VECTOR_PREFIX + "MUL_ADD_VS2VI" + POSTFIX;
1149     static {
1150         vectorNode(MUL_ADD_VS2VI, "MulAddVS2VI", TYPE_INT);
1151     }
1152 
1153     // Can only be used if avx512_vnni is available.
1154     public static final String MUL_ADD_VS2VI_VNNI = PREFIX + "MUL_ADD_VS2VI_VNNI" + POSTFIX;
1155     static {
1156         machOnly(MUL_ADD_VS2VI_VNNI, "vmuladdaddS2I_reg");
1157     }
1158 
1159     public static final String MUL_D = PREFIX + "MUL_D" + POSTFIX;
1160     static {
1161         beforeMatchingNameRegex(MUL_D, "MulD");
1162     }
1163 
1164     public static final String MUL_F = PREFIX + "MUL_F" + POSTFIX;
1165     static {
1166         beforeMatchingNameRegex(MUL_F, "MulF");
1167     }
1168 
1169     public static final String MUL_I = PREFIX + "MUL_I" + POSTFIX;
1170     static {
1171         beforeMatchingNameRegex(MUL_I, "MulI");
1172     }
1173 
1174     public static final String MUL_L = PREFIX + "MUL_L" + POSTFIX;
1175     static {
1176         beforeMatchingNameRegex(MUL_L, "MulL");
1177     }
1178 
1179     public static final String MUL_VL = VECTOR_PREFIX + "MUL_VL" + POSTFIX;
1180     static {
1181         vectorNode(MUL_VL, "MulVL", TYPE_LONG);
1182     }
1183 
1184     public static final String MUL_VI = VECTOR_PREFIX + "MUL_VI" + POSTFIX;
1185     static {
1186         vectorNode(MUL_VI, "MulVI", TYPE_INT);
1187     }
1188 
1189     public static final String MUL_VF = VECTOR_PREFIX + "MUL_VF" + POSTFIX;
1190     static {
1191         vectorNode(MUL_VF, "MulVF", TYPE_FLOAT);
1192     }
1193 
1194     public static final String MUL_VD = VECTOR_PREFIX + "MUL_VD" + POSTFIX;
1195     static {
1196         vectorNode(MUL_VD, "MulVD", TYPE_DOUBLE);
1197     }
1198 
1199     public static final String MUL_VB = VECTOR_PREFIX + "MUL_VB" + POSTFIX;
1200     static {
1201         vectorNode(MUL_VB, "MulVB", TYPE_BYTE);
1202     }
1203 
1204     public static final String MUL_VS = VECTOR_PREFIX + "MUL_VS" + POSTFIX;
1205     static {
1206         vectorNode(MUL_VS, "MulVS", TYPE_SHORT);
1207     }
1208 
1209     public static final String MUL_REDUCTION_VD = PREFIX + "MUL_REDUCTION_VD" + POSTFIX;
1210     static {
1211         superWordNodes(MUL_REDUCTION_VD, "MulReductionVD");
1212     }
1213 
1214     public static final String MUL_REDUCTION_VF = PREFIX + "MUL_REDUCTION_VF" + POSTFIX;
1215     static {
1216         superWordNodes(MUL_REDUCTION_VF, "MulReductionVF");
1217     }
1218 
1219     public static final String MUL_REDUCTION_VI = PREFIX + "MUL_REDUCTION_VI" + POSTFIX;
1220     static {
1221         superWordNodes(MUL_REDUCTION_VI, "MulReductionVI");
1222     }
1223 
1224     public static final String MUL_REDUCTION_VL = PREFIX + "MUL_REDUCTION_VL" + POSTFIX;
1225     static {
1226         superWordNodes(MUL_REDUCTION_VL, "MulReductionVL");
1227     }
1228 
1229     public static final String MIN_REDUCTION_V = PREFIX + "MIN_REDUCTION_V" + POSTFIX;
1230     static {
1231         superWordNodes(MIN_REDUCTION_V, "MinReductionV");
1232     }
1233 
1234     public static final String MAX_REDUCTION_V = PREFIX + "MAX_REDUCTION_V" + POSTFIX;
1235     static {
1236         superWordNodes(MAX_REDUCTION_V, "MaxReductionV");
1237     }
1238 
1239     public static final String NEG_VF = VECTOR_PREFIX + "NEG_VF" + POSTFIX;
1240     static {
1241         vectorNode(NEG_VF, "NegVF", TYPE_FLOAT);
1242     }
1243 
1244     public static final String NEG_VD = VECTOR_PREFIX + "NEG_VD" + POSTFIX;
1245     static {
1246         vectorNode(NEG_VD, "NegVD", TYPE_DOUBLE);
1247     }
1248 
1249     public static final String NOP = PREFIX + "NOP" + POSTFIX;
1250     static {
1251         machOnlyNameRegex(NOP, "Nop");
1252     }
1253 
1254     public static final String NULL_ASSERT_TRAP = PREFIX + "NULL_ASSERT_TRAP" + POSTFIX;
1255     static {
1256         trapNodes(NULL_ASSERT_TRAP, "null_assert");
1257     }
1258 
1259     public static final String NULL_CHECK_TRAP = PREFIX + "NULL_CHECK_TRAP" + POSTFIX;
1260     static {
1261         trapNodes(NULL_CHECK_TRAP, "null_check");
1262     }
1263 
1264     public static final String OOPMAP_WITH = COMPOSITE_PREFIX + "OOPMAP_WITH" + POSTFIX;
1265     static {
1266         String regex = "(#\\s*OopMap\\s*\\{.*" + IS_REPLACED + ".*\\})";
1267         optoOnly(OOPMAP_WITH, regex);
1268     }
1269 
1270     public static final String OR_VB = VECTOR_PREFIX + "OR_VB" + POSTFIX;
1271     static {
1272         vectorNode(OR_VB, "OrV", TYPE_BYTE);
1273     }
1274 
1275     public static final String OR_VS = VECTOR_PREFIX + "OR_VS" + POSTFIX;
1276     static {
1277         vectorNode(OR_VS, "OrV", TYPE_SHORT);
1278     }
1279 
1280     public static final String OR_VI = VECTOR_PREFIX + "OR_VI" + POSTFIX;
1281     static {
1282         vectorNode(OR_VI, "OrV", TYPE_INT);
1283     }
1284 
1285     public static final String OR_VL = VECTOR_PREFIX + "OR_VL" + POSTFIX;
1286     static {
1287         vectorNode(OR_VL, "OrV", TYPE_LONG);
1288     }
1289 
1290     public static final String OR_V_MASK = PREFIX + "OR_V_MASK" + POSTFIX;
1291     static {
1292         beforeMatchingNameRegex(OR_V_MASK, "OrVMask");
1293     }
1294 
1295     public static final String OR_REDUCTION_V = PREFIX + "OR_REDUCTION_V" + POSTFIX;
1296     static {
1297         superWordNodes(OR_REDUCTION_V, "OrReductionV");
1298     }
1299 
1300     public static final String OUTER_STRIP_MINED_LOOP = PREFIX + "OUTER_STRIP_MINED_LOOP" + POSTFIX;
1301     static {
1302         String regex = START + "OuterStripMinedLoop\\b" + MID + END;
1303         fromAfterCountedLoops(OUTER_STRIP_MINED_LOOP, regex);
1304     }
1305 
1306     public static final String PARTIAL_SUBTYPE_CHECK = PREFIX + "PARTIAL_SUBTYPE_CHECK" + POSTFIX;
1307     static {
1308         beforeMatchingNameRegex(PARTIAL_SUBTYPE_CHECK, "PartialSubtypeCheck");
1309     }
1310 
1311     public static final String PHI = PREFIX + "PHI" + POSTFIX;
1312     static {
1313         beforeMatchingNameRegex(PHI, "Phi");
1314     }
1315 
1316     public static final String POPCOUNT_L = PREFIX + "POPCOUNT_L" + POSTFIX;
1317     static {
1318         beforeMatchingNameRegex(POPCOUNT_L, "PopCountL");
1319     }
1320 
1321     public static final String POPCOUNT_VI = VECTOR_PREFIX + "POPCOUNT_VI" + POSTFIX;
1322     static {
1323         vectorNode(POPCOUNT_VI, "PopCountVI", TYPE_INT);
1324     }
1325 
1326     public static final String POPCOUNT_VL = VECTOR_PREFIX + "POPCOUNT_VL" + POSTFIX;
1327     static {
1328         vectorNode(POPCOUNT_VL, "PopCountVL", TYPE_LONG);
1329     }
1330 
1331     public static final String COUNT_TRAILING_ZEROS_VL = VECTOR_PREFIX + "COUNT_TRAILING_ZEROS_VL" + POSTFIX;
1332     static {
1333         vectorNode(COUNT_TRAILING_ZEROS_VL, "CountTrailingZerosV", TYPE_LONG);
1334     }
1335 
1336     public static final String COUNT_TRAILING_ZEROS_VI = VECTOR_PREFIX + "COUNT_TRAILING_ZEROS_VI" + POSTFIX;
1337     static {
1338         vectorNode(COUNT_TRAILING_ZEROS_VI, "CountTrailingZerosV", TYPE_INT);
1339     }
1340 
1341     public static final String COUNT_LEADING_ZEROS_VL = VECTOR_PREFIX + "COUNT_LEADING_ZEROS_VL" + POSTFIX;
1342     static {
1343         vectorNode(COUNT_LEADING_ZEROS_VL, "CountLeadingZerosV", TYPE_LONG);
1344     }
1345 
1346     public static final String COUNT_LEADING_ZEROS_VI = VECTOR_PREFIX + "COUNT_LEADING_ZEROS_VI" + POSTFIX;
1347     static {
1348         vectorNode(COUNT_LEADING_ZEROS_VI, "CountLeadingZerosV", TYPE_INT);
1349     }
1350 
1351     public static final String POPULATE_INDEX = PREFIX + "POPULATE_INDEX" + POSTFIX;
1352     static {
1353         String regex = START + "PopulateIndex" + MID + END;
1354         IR_NODE_MAPPINGS.put(POPULATE_INDEX, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
1355                                                                        CompilePhase.AFTER_CLOOPS,
1356                                                                        CompilePhase.BEFORE_MATCHING));
1357     }
1358 
1359     public static final String PREDICATE_TRAP = PREFIX + "PREDICATE_TRAP" + POSTFIX;
1360     static {
1361         trapNodes(PREDICATE_TRAP, "predicate");
1362     }
1363 
1364     public static final String RANGE_CHECK_TRAP = PREFIX + "RANGE_CHECK_TRAP" + POSTFIX;
1365     static {
1366         trapNodes(RANGE_CHECK_TRAP, "range_check");
1367     }
1368 
1369     public static final String REPLICATE_B = VECTOR_PREFIX + "REPLICATE_B" + POSTFIX;
1370     static {
1371         vectorNode(REPLICATE_B, "Replicate", TYPE_BYTE);
1372     }
1373 
1374     public static final String REPLICATE_S = VECTOR_PREFIX + "REPLICATE_S" + POSTFIX;
1375     static {
1376         vectorNode(REPLICATE_S, "Replicate", TYPE_SHORT);
1377     }
1378 
1379     public static final String REPLICATE_I = VECTOR_PREFIX + "REPLICATE_I" + POSTFIX;
1380     static {
1381         vectorNode(REPLICATE_I, "Replicate", TYPE_INT);
1382     }
1383 
1384     public static final String REPLICATE_L = VECTOR_PREFIX + "REPLICATE_L" + POSTFIX;
1385     static {
1386         vectorNode(REPLICATE_L, "Replicate", TYPE_LONG);
1387     }
1388 
1389     public static final String REPLICATE_F = VECTOR_PREFIX + "REPLICATE_F" + POSTFIX;
1390     static {
1391         vectorNode(REPLICATE_F, "Replicate", TYPE_FLOAT);
1392     }
1393 
1394     public static final String REPLICATE_D = VECTOR_PREFIX + "REPLICATE_D" + POSTFIX;
1395     static {
1396         vectorNode(REPLICATE_D, "Replicate", TYPE_DOUBLE);
1397     }
1398 
1399     public static final String REVERSE_BYTES_VB = VECTOR_PREFIX + "REVERSE_BYTES_VB" + POSTFIX;
1400     static {
1401         vectorNode(REVERSE_BYTES_VB, "ReverseBytesV", TYPE_BYTE);
1402     }
1403 
1404     public static final String REVERSE_BYTES_VS = VECTOR_PREFIX + "REVERSE_BYTES_VS" + POSTFIX;
1405     static {
1406         vectorNode(REVERSE_BYTES_VS, "ReverseBytesV", TYPE_SHORT);
1407     }
1408 
1409     public static final String REVERSE_BYTES_VI = VECTOR_PREFIX + "REVERSE_BYTES_VI" + POSTFIX;
1410     static {
1411         vectorNode(REVERSE_BYTES_VI, "ReverseBytesV", TYPE_INT);
1412     }
1413 
1414     public static final String REVERSE_BYTES_VL = VECTOR_PREFIX + "REVERSE_BYTES_VL" + POSTFIX;
1415     static {
1416         vectorNode(REVERSE_BYTES_VL, "ReverseBytesV", TYPE_LONG);
1417     }
1418 
1419     public static final String REVERSE_I = PREFIX + "REVERSE_I" + POSTFIX;
1420     static {
1421         beforeMatchingNameRegex(REVERSE_I, "ReverseI");
1422     }
1423 
1424     public static final String REVERSE_L = PREFIX + "REVERSE_L" + POSTFIX;
1425     static {
1426         beforeMatchingNameRegex(REVERSE_L, "ReverseL");
1427     }
1428 
1429     public static final String REVERSE_VI = VECTOR_PREFIX + "REVERSE_VI" + POSTFIX;
1430     static {
1431         vectorNode(REVERSE_VI, "ReverseV", TYPE_INT);
1432     }
1433 
1434     public static final String REVERSE_VL = VECTOR_PREFIX + "REVERSE_VL" + POSTFIX;
1435     static {
1436         vectorNode(REVERSE_VL, "ReverseV", TYPE_LONG);
1437     }
1438 
1439     public static final String ROUND_VD = VECTOR_PREFIX + "ROUND_VD" + POSTFIX;
1440     static {
1441         vectorNode(ROUND_VD, "RoundVD", TYPE_LONG);
1442     }
1443 
1444     public static final String ROUND_VF = VECTOR_PREFIX + "ROUND_VF" + POSTFIX;
1445     static {
1446         vectorNode(ROUND_VF, "RoundVF", TYPE_INT);
1447     }
1448 
1449     public static final String ROTATE_LEFT = PREFIX + "ROTATE_LEFT" + POSTFIX;
1450     static {
1451         beforeMatchingNameRegex(ROTATE_LEFT, "RotateLeft");
1452     }
1453 
1454     public static final String ROTATE_RIGHT = PREFIX + "ROTATE_RIGHT" + POSTFIX;
1455     static {
1456         beforeMatchingNameRegex(ROTATE_RIGHT, "RotateRight");
1457     }
1458 
1459     public static final String ROTATE_LEFT_V = PREFIX + "ROTATE_LEFT_V" + POSTFIX;
1460     static {
1461         beforeMatchingNameRegex(ROTATE_LEFT_V, "RotateLeftV");
1462     }
1463 
1464     public static final String ROTATE_RIGHT_V = PREFIX + "ROTATE_RIGHT_V" + POSTFIX;
1465     static {
1466         beforeMatchingNameRegex(ROTATE_RIGHT_V, "RotateRightV");
1467     }
1468 
1469     public static final String ROUND_DOUBLE_MODE_V = VECTOR_PREFIX + "ROUND_DOUBLE_MODE_V" + POSTFIX;
1470     static {
1471         vectorNode(ROUND_DOUBLE_MODE_V, "RoundDoubleModeV", TYPE_DOUBLE);
1472     }
1473 
1474     public static final String RSHIFT = PREFIX + "RSHIFT" + POSTFIX;
1475     static {
1476         beforeMatchingNameRegex(RSHIFT, "RShift(I|L)");
1477     }
1478 
1479     public static final String RSHIFT_I = PREFIX + "RSHIFT_I" + POSTFIX;
1480     static {
1481         beforeMatchingNameRegex(RSHIFT_I, "RShiftI");
1482     }
1483 
1484     public static final String RSHIFT_L = PREFIX + "RSHIFT_L" + POSTFIX;
1485     static {
1486         beforeMatchingNameRegex(RSHIFT_L, "RShiftL");
1487     }
1488 
1489     public static final String RSHIFT_VB = VECTOR_PREFIX + "RSHIFT_VB" + POSTFIX;
1490     static {
1491         vectorNode(RSHIFT_VB, "RShiftVB", TYPE_BYTE);
1492     }
1493 
1494     public static final String RSHIFT_VS = VECTOR_PREFIX + "RSHIFT_VS" + POSTFIX;
1495     static {
1496         vectorNode(RSHIFT_VS, "RShiftVS", TYPE_SHORT);
1497     }
1498 
1499     public static final String RSHIFT_VC = VECTOR_PREFIX + "RSHIFT_VC" + POSTFIX;
1500     static {
1501         vectorNode(RSHIFT_VC, "RShiftVS", TYPE_CHAR); // short computation with char type
1502     }
1503 
1504     public static final String RSHIFT_VI = VECTOR_PREFIX + "RSHIFT_VI" + POSTFIX;
1505     static {
1506         vectorNode(RSHIFT_VI, "RShiftVI", TYPE_INT);
1507     }
1508 
1509     public static final String RSHIFT_VL = VECTOR_PREFIX + "RSHIFT_VL" + POSTFIX;
1510     static {
1511         vectorNode(RSHIFT_VL, "RShiftVL", TYPE_LONG);
1512     }
1513 
1514     public static final String SAFEPOINT = PREFIX + "SAFEPOINT" + POSTFIX;
1515     static {
1516         beforeMatchingNameRegex(SAFEPOINT, "SafePoint");
1517     }
1518 
1519     public static final String SCOPE_OBJECT = PREFIX + "SCOPE_OBJECT" + POSTFIX;
1520     static {
1521         String regex = "(.*# ScObj.*" + END;
1522         optoOnly(SCOPE_OBJECT, regex);
1523     }
1524 
1525     public static final String SIGNUM_VD = VECTOR_PREFIX + "SIGNUM_VD" + POSTFIX;
1526     static {
1527         vectorNode(SIGNUM_VD, "SignumVD", TYPE_DOUBLE);
1528     }
1529 
1530     public static final String SIGNUM_VF = VECTOR_PREFIX + "SIGNUM_VF" + POSTFIX;
1531     static {
1532         vectorNode(SIGNUM_VF, "SignumVF", TYPE_FLOAT);
1533     }
1534 
1535     public static final String SQRT_VF = VECTOR_PREFIX + "SQRT_VF" + POSTFIX;
1536     static {
1537         vectorNode(SQRT_VF, "SqrtVF", TYPE_FLOAT);
1538     }
1539 
1540     public static final String SQRT_VD = VECTOR_PREFIX + "SQRT_VD" + POSTFIX;
1541     static {
1542         vectorNode(SQRT_VD, "SqrtVD", TYPE_DOUBLE);
1543     }
1544 
1545     public static final String STORE = PREFIX + "STORE" + POSTFIX;
1546     static {
1547         beforeMatchingNameRegex(STORE, "Store(B|C|S|I|L|F|D|P|N)");
1548     }
1549 
1550     public static final String STORE_B = PREFIX + "STORE_B" + POSTFIX;
1551     static {
1552         beforeMatchingNameRegex(STORE_B, "StoreB");
1553     }
1554 
1555     public static final String STORE_B_OF_CLASS = COMPOSITE_PREFIX + "STORE_B_OF_CLASS" + POSTFIX;
1556     static {
1557         storeOfNodes(STORE_B_OF_CLASS, "StoreB");
1558     }
1559 
1560     public static final String STORE_C = PREFIX + "STORE_C" + POSTFIX;
1561     static {
1562         beforeMatchingNameRegex(STORE_C, "StoreC");
1563     }
1564 
1565     public static final String STORE_C_OF_CLASS = COMPOSITE_PREFIX + "STORE_C_OF_CLASS" + POSTFIX;
1566     static {
1567         storeOfNodes(STORE_C_OF_CLASS, "StoreC");
1568     }
1569 
1570     public static final String STORE_D = PREFIX + "STORE_D" + POSTFIX;
1571     static {
1572         beforeMatchingNameRegex(STORE_D, "StoreD");
1573     }
1574 
1575     public static final String STORE_D_OF_CLASS = COMPOSITE_PREFIX + "STORE_D_OF_CLASS" + POSTFIX;
1576     static {
1577         storeOfNodes(STORE_D_OF_CLASS, "StoreD");
1578     }
1579 
1580     public static final String STORE_F = PREFIX + "STORE_F" + POSTFIX;
1581     static {
1582         beforeMatchingNameRegex(STORE_F, "StoreF");
1583     }
1584 
1585     public static final String STORE_F_OF_CLASS = COMPOSITE_PREFIX + "STORE_F_OF_CLASS" + POSTFIX;
1586     static {
1587         storeOfNodes(STORE_F_OF_CLASS, "StoreF");
1588     }
1589 
1590     public static final String STORE_I = PREFIX + "STORE_I" + POSTFIX;
1591     static {
1592         beforeMatchingNameRegex(STORE_I, "StoreI");
1593     }
1594 
1595     public static final String STORE_I_OF_CLASS = COMPOSITE_PREFIX + "STORE_I_OF_CLASS" + POSTFIX;
1596     static {
1597         storeOfNodes(STORE_I_OF_CLASS, "StoreI");
1598     }
1599 
1600     public static final String STORE_L = PREFIX + "STORE_L" + POSTFIX;
1601     static {
1602         beforeMatchingNameRegex(STORE_L, "StoreL");
1603     }
1604 
1605     public static final String STORE_L_OF_CLASS = COMPOSITE_PREFIX + "STORE_L_OF_CLASS" + POSTFIX;
1606     static {
1607         storeOfNodes(STORE_L_OF_CLASS, "StoreL");
1608     }
1609 
1610     public static final String STORE_N = PREFIX + "STORE_N" + POSTFIX;
1611     static {
1612         beforeMatchingNameRegex(STORE_N, "StoreN");
1613     }
1614 
1615     public static final String STORE_N_OF_CLASS = COMPOSITE_PREFIX + "STORE_N_OF_CLASS" + POSTFIX;
1616     static {
1617         storeOfNodes(STORE_N_OF_CLASS, "StoreN");
1618     }
1619 
1620     public static final String STORE_OF_CLASS = COMPOSITE_PREFIX + "STORE_OF_CLASS" + POSTFIX;
1621     static {
1622         storeOfNodes(STORE_OF_CLASS, "Store(B|C|S|I|L|F|D|P|N)");
1623     }
1624 
1625     public static final String STORE_OF_FIELD = COMPOSITE_PREFIX + "STORE_OF_FIELD" + POSTFIX;
1626     static {
1627         String regex = START + "Store(B|C|S|I|L|F|D|P|N)" + MID + "@.*name=" + IS_REPLACED + ",.*" + END;
1628         beforeMatching(STORE_OF_FIELD, regex);
1629     }
1630 
1631     public static final String STORE_P = PREFIX + "STORE_P" + POSTFIX;
1632     static {
1633         beforeMatchingNameRegex(STORE_P, "StoreP");
1634     }
1635 
1636     public static final String STORE_P_OF_CLASS = COMPOSITE_PREFIX + "STORE_P_OF_CLASS" + POSTFIX;
1637     static {
1638         storeOfNodes(STORE_P_OF_CLASS, "StoreP");
1639     }
1640 
1641     public static final String STORE_VECTOR = PREFIX + "STORE_VECTOR" + POSTFIX;
1642     static {
1643         beforeMatchingNameRegex(STORE_VECTOR, "StoreVector");
1644     }
1645 
1646     public static final String STORE_VECTOR_SCATTER = PREFIX + "STORE_VECTOR_SCATTER" + POSTFIX;
1647     static {
1648         beforeMatchingNameRegex(STORE_VECTOR_SCATTER, "StoreVectorScatter");
1649     }
1650 
1651     public static final String STORE_VECTOR_MASKED = PREFIX + "STORE_VECTOR_MASKED" + POSTFIX;
1652     static {
1653         beforeMatchingNameRegex(STORE_VECTOR_MASKED, "StoreVectorMasked");
1654     }
1655 
1656     public static final String STORE_VECTOR_SCATTER_MASKED = PREFIX + "STORE_VECTOR_SCATTER_MASKED" + POSTFIX;
1657     static {
1658         beforeMatchingNameRegex(STORE_VECTOR_SCATTER_MASKED, "StoreVectorScatterMasked");
1659     }
1660 
1661     public static final String SUB = PREFIX + "SUB" + POSTFIX;
1662     static {
1663         beforeMatchingNameRegex(SUB, "Sub(I|L|F|D)");
1664     }
1665 
1666     public static final String SUB_D = PREFIX + "SUB_D" + POSTFIX;
1667     static {
1668         beforeMatchingNameRegex(SUB_D, "SubD");
1669     }
1670 
1671     public static final String SUB_F = PREFIX + "SUB_F" + POSTFIX;
1672     static {
1673         beforeMatchingNameRegex(SUB_F, "SubF");
1674     }
1675 
1676     public static final String SUB_I = PREFIX + "SUB_I" + POSTFIX;
1677     static {
1678         beforeMatchingNameRegex(SUB_I, "SubI");
1679     }
1680 
1681     public static final String SUB_L = PREFIX + "SUB_L" + POSTFIX;
1682     static {
1683         beforeMatchingNameRegex(SUB_L, "SubL");
1684     }
1685 
1686     public static final String SUB_VB = VECTOR_PREFIX + "SUB_VB" + POSTFIX;
1687     static {
1688         vectorNode(SUB_VB, "SubVB", TYPE_BYTE);
1689     }
1690 
1691     public static final String SUB_VS = VECTOR_PREFIX + "SUB_VS" + POSTFIX;
1692     static {
1693         vectorNode(SUB_VS, "SubVS", TYPE_SHORT);
1694     }
1695 
1696     public static final String SUB_VI = VECTOR_PREFIX + "SUB_VI" + POSTFIX;
1697     static {
1698         vectorNode(SUB_VI, "SubVI", TYPE_INT);
1699     }
1700 
1701     public static final String SUB_VL = VECTOR_PREFIX + "SUB_VL" + POSTFIX;
1702     static {
1703         vectorNode(SUB_VL, "SubVL", TYPE_LONG);
1704     }
1705 
1706     public static final String SUB_VF = VECTOR_PREFIX + "SUB_VF" + POSTFIX;
1707     static {
1708         vectorNode(SUB_VF, "SubVF", TYPE_FLOAT);
1709     }
1710 
1711     public static final String SUB_VD = VECTOR_PREFIX + "SUB_VD" + POSTFIX;
1712     static {
1713         vectorNode(SUB_VD, "SubVD", TYPE_DOUBLE);
1714     }
1715 
1716     public static final String SUBTYPE_CHECK = PREFIX + "SUBTYPE_CHECK" + POSTFIX;
1717     static {
1718         macroNodes(SUBTYPE_CHECK, "SubTypeCheck");
1719     }
1720 
1721     public static final String TRAP = PREFIX + "TRAP" + POSTFIX;
1722     static {
1723         trapNodes(TRAP, "reason");
1724     }
1725 
1726     public static final String UDIV_I = PREFIX + "UDIV_I" + POSTFIX;
1727     static {
1728         beforeMatchingNameRegex(UDIV_I, "UDivI");
1729     }
1730 
1731     public static final String UDIV_L = PREFIX + "UDIV_L" + POSTFIX;
1732     static {
1733         beforeMatchingNameRegex(UDIV_L, "UDivL");
1734     }
1735 
1736     public static final String UDIV_MOD_I = PREFIX + "UDIV_MOD_I" + POSTFIX;
1737     static {
1738         beforeMatchingNameRegex(UDIV_MOD_I, "UDivModI");
1739     }
1740 
1741     public static final String UDIV_MOD_L = PREFIX + "UDIV_MOD_L" + POSTFIX;
1742     static {
1743         beforeMatchingNameRegex(UDIV_MOD_L, "UDivModL");
1744     }
1745 
1746     public static final String UMOD_I = PREFIX + "UMOD_I" + POSTFIX;
1747     static {
1748         beforeMatchingNameRegex(UMOD_I, "UModI");
1749     }
1750 
1751     public static final String UMOD_L = PREFIX + "UMOD_L" + POSTFIX;
1752     static {
1753         beforeMatchingNameRegex(UMOD_L, "UModL");
1754     }
1755 
1756     public static final String UNHANDLED_TRAP = PREFIX + "UNHANDLED_TRAP" + POSTFIX;
1757     static {
1758         trapNodes(UNHANDLED_TRAP, "unhandled");
1759     }
1760 
1761     public static final String UNSTABLE_IF_TRAP = PREFIX + "UNSTABLE_IF_TRAP" + POSTFIX;
1762     static {
1763         trapNodes(UNSTABLE_IF_TRAP, "unstable_if");
1764     }
1765 
1766     public static final String UNREACHED_TRAP = PREFIX + "UNREACHED_TRAP" + POSTFIX;
1767     static {
1768         trapNodes(UNREACHED_TRAP, "unreached");
1769     }
1770 
1771     public static final String URSHIFT = PREFIX + "URSHIFT" + POSTFIX;
1772     static {
1773         beforeMatchingNameRegex(URSHIFT, "URShift(B|S|I|L)");
1774     }
1775 
1776     public static final String URSHIFT_B = PREFIX + "URSHIFT_B" + POSTFIX;
1777     static {
1778         beforeMatchingNameRegex(URSHIFT_B, "URShiftB");
1779     }
1780 
1781     public static final String URSHIFT_I = PREFIX + "URSHIFT_I" + POSTFIX;
1782     static {
1783         beforeMatchingNameRegex(URSHIFT_I, "URShiftI");
1784     }
1785 
1786     public static final String URSHIFT_L = PREFIX + "URSHIFT_L" + POSTFIX;
1787     static {
1788         beforeMatchingNameRegex(URSHIFT_L, "URShiftL");
1789     }
1790 
1791     public static final String URSHIFT_S = PREFIX + "URSHIFT_S" + POSTFIX;
1792     static {
1793         beforeMatchingNameRegex(URSHIFT_S, "URShiftS");
1794     }
1795 
1796     public static final String URSHIFT_VB = VECTOR_PREFIX + "URSHIFT_VB" + POSTFIX;
1797     static {
1798         vectorNode(URSHIFT_VB, "URShiftVB", TYPE_BYTE);
1799     }
1800 
1801     public static final String URSHIFT_VS = VECTOR_PREFIX + "URSHIFT_VS" + POSTFIX;
1802     static {
1803         vectorNode(URSHIFT_VS, "URShiftVS", TYPE_SHORT);
1804     }
1805 
1806     public static final String URSHIFT_VC = VECTOR_PREFIX + "URSHIFT_VC" + POSTFIX;
1807     static {
1808         vectorNode(URSHIFT_VC, "URShiftVS", TYPE_CHAR); // short computation with char type
1809     }
1810 
1811     public static final String URSHIFT_VI = VECTOR_PREFIX + "URSHIFT_VI" + POSTFIX;
1812     static {
1813         vectorNode(URSHIFT_VI, "URShiftVI", TYPE_INT);
1814     }
1815 
1816     public static final String URSHIFT_VL = VECTOR_PREFIX + "URSHIFT_VL" + POSTFIX;
1817     static {
1818         vectorNode(URSHIFT_VL, "URShiftVL", TYPE_LONG);
1819     }
1820 
1821     public static final String VAND_NOT_I = PREFIX + "VAND_NOT_I" + POSTFIX;
1822     static {
1823         machOnlyNameRegex(VAND_NOT_I, "vand_notI");
1824     }
1825 
1826     public static final String VAND_NOT_L = PREFIX + "VAND_NOT_L" + POSTFIX;
1827     static {
1828         machOnlyNameRegex(VAND_NOT_L, "vand_notL");
1829     }
1830 
1831     public static final String VECTOR_BLEND_B = VECTOR_PREFIX + "VECTOR_BLEND_B" + POSTFIX;
1832     static {
1833         vectorNode(VECTOR_BLEND_B, "VectorBlend", TYPE_BYTE);
1834     }
1835 
1836     public static final String VECTOR_BLEND_F = VECTOR_PREFIX + "VECTOR_BLEND_F" + POSTFIX;
1837     static {
1838         vectorNode(VECTOR_BLEND_F, "VectorBlend", TYPE_FLOAT);
1839     }
1840 
1841     public static final String VECTOR_BLEND_D = VECTOR_PREFIX + "VECTOR_BLEND_D" + POSTFIX;
1842     static {
1843         vectorNode(VECTOR_BLEND_D, "VectorBlend", TYPE_DOUBLE);
1844     }
1845 
1846     public static final String VECTOR_MASK_CMP_I = VECTOR_PREFIX + "VECTOR_MASK_CMP_I" + POSTFIX;
1847     static {
1848         vectorNode(VECTOR_MASK_CMP_I, "VectorMaskCmp", TYPE_INT);
1849     }
1850 
1851     public static final String VECTOR_MASK_CMP_L = VECTOR_PREFIX + "VECTOR_MASK_CMP_L" + POSTFIX;
1852     static {
1853         vectorNode(VECTOR_MASK_CMP_L, "VectorMaskCmp", TYPE_LONG);
1854     }
1855 
1856     public static final String VECTOR_MASK_CMP_F = VECTOR_PREFIX + "VECTOR_MASK_CMP_F" + POSTFIX;
1857     static {
1858         vectorNode(VECTOR_MASK_CMP_F, "VectorMaskCmp", TYPE_FLOAT);
1859     }
1860 
1861     public static final String VECTOR_MASK_CMP_D = VECTOR_PREFIX + "VECTOR_MASK_CMP_D" + POSTFIX;
1862     static {
1863         vectorNode(VECTOR_MASK_CMP_D, "VectorMaskCmp", TYPE_DOUBLE);
1864     }
1865 
1866     public static final String VECTOR_CAST_B2S = VECTOR_PREFIX + "VECTOR_CAST_B2S" + POSTFIX;
1867     static {
1868         vectorNode(VECTOR_CAST_B2S, "VectorCastB2X", TYPE_SHORT);
1869     }
1870 
1871     public static final String VECTOR_CAST_B2I = VECTOR_PREFIX + "VECTOR_CAST_B2I" + POSTFIX;
1872     static {
1873         vectorNode(VECTOR_CAST_B2I, "VectorCastB2X", TYPE_INT);
1874     }
1875 
1876     public static final String VECTOR_CAST_B2L = VECTOR_PREFIX + "VECTOR_CAST_B2L" + POSTFIX;
1877     static {
1878         vectorNode(VECTOR_CAST_B2L, "VectorCastB2X", TYPE_LONG);
1879     }
1880 
1881     public static final String VECTOR_CAST_B2F = VECTOR_PREFIX + "VECTOR_CAST_B2F" + POSTFIX;
1882     static {
1883         vectorNode(VECTOR_CAST_B2F, "VectorCastB2X", TYPE_FLOAT);
1884     }
1885 
1886     public static final String VECTOR_CAST_B2D = VECTOR_PREFIX + "VECTOR_CAST_B2D" + POSTFIX;
1887     static {
1888         vectorNode(VECTOR_CAST_B2D, "VectorCastB2X", TYPE_DOUBLE);
1889     }
1890 
1891     public static final String VECTOR_CAST_D2B = VECTOR_PREFIX + "VECTOR_CAST_D2B" + POSTFIX;
1892     static {
1893         vectorNode(VECTOR_CAST_D2B, "VectorCastD2X", TYPE_BYTE);
1894     }
1895 
1896     public static final String VECTOR_CAST_D2S = VECTOR_PREFIX + "VECTOR_CAST_D2S" + POSTFIX;
1897     static {
1898         vectorNode(VECTOR_CAST_D2S, "VectorCastD2X", TYPE_SHORT);
1899     }
1900 
1901     public static final String VECTOR_CAST_D2I = VECTOR_PREFIX + "VECTOR_CAST_D2I" + POSTFIX;
1902     static {
1903         vectorNode(VECTOR_CAST_D2I, "VectorCastD2X", TYPE_INT);
1904     }
1905 
1906     public static final String VECTOR_CAST_D2L = VECTOR_PREFIX + "VECTOR_CAST_D2L" + POSTFIX;
1907     static {
1908         vectorNode(VECTOR_CAST_D2L, "VectorCastD2X", TYPE_LONG);
1909     }
1910 
1911     public static final String VECTOR_CAST_D2F = VECTOR_PREFIX + "VECTOR_CAST_D2F" + POSTFIX;
1912     static {
1913         vectorNode(VECTOR_CAST_D2F, "VectorCastD2X", TYPE_FLOAT);
1914     }
1915 
1916     public static final String VECTOR_CAST_F2B = VECTOR_PREFIX + "VECTOR_CAST_F2B" + POSTFIX;
1917     static {
1918         vectorNode(VECTOR_CAST_F2B, "VectorCastF2X", TYPE_BYTE);
1919     }
1920 
1921     public static final String VECTOR_CAST_F2S = VECTOR_PREFIX + "VECTOR_CAST_F2S" + POSTFIX;
1922     static {
1923         vectorNode(VECTOR_CAST_F2S, "VectorCastF2X", TYPE_SHORT);
1924     }
1925 
1926     public static final String VECTOR_CAST_F2I = VECTOR_PREFIX + "VECTOR_CAST_F2I" + POSTFIX;
1927     static {
1928         vectorNode(VECTOR_CAST_F2I, "VectorCastF2X", TYPE_INT);
1929     }
1930 
1931     public static final String VECTOR_CAST_F2L = VECTOR_PREFIX + "VECTOR_CAST_F2L" + POSTFIX;
1932     static {
1933         vectorNode(VECTOR_CAST_F2L, "VectorCastF2X", TYPE_LONG);
1934     }
1935 
1936     public static final String VECTOR_CAST_F2D = VECTOR_PREFIX + "VECTOR_CAST_F2D" + POSTFIX;
1937     static {
1938         vectorNode(VECTOR_CAST_F2D, "VectorCastF2X", TYPE_DOUBLE);
1939     }
1940 
1941     public static final String VECTOR_CAST_I2B = VECTOR_PREFIX + "VECTOR_CAST_I2B" + POSTFIX;
1942     static {
1943         vectorNode(VECTOR_CAST_I2B, "VectorCastI2X", TYPE_BYTE);
1944     }
1945 
1946     public static final String VECTOR_CAST_I2S = VECTOR_PREFIX + "VECTOR_CAST_I2S" + POSTFIX;
1947     static {
1948         vectorNode(VECTOR_CAST_I2S, "VectorCastI2X", TYPE_SHORT);
1949     }
1950 
1951     public static final String VECTOR_CAST_I2L = VECTOR_PREFIX + "VECTOR_CAST_I2L" + POSTFIX;
1952     static {
1953         vectorNode(VECTOR_CAST_I2L, "VectorCastI2X", TYPE_LONG);
1954     }
1955 
1956     public static final String VECTOR_CAST_I2F = VECTOR_PREFIX + "VECTOR_CAST_I2F" + POSTFIX;
1957     static {
1958         vectorNode(VECTOR_CAST_I2F, "VectorCastI2X", TYPE_FLOAT);
1959     }
1960 
1961     public static final String VECTOR_CAST_I2D = VECTOR_PREFIX + "VECTOR_CAST_I2D" + POSTFIX;
1962     static {
1963         vectorNode(VECTOR_CAST_I2D, "VectorCastI2X", TYPE_DOUBLE);
1964     }
1965 
1966     public static final String VECTOR_CAST_L2B = VECTOR_PREFIX + "VECTOR_CAST_L2B" + POSTFIX;
1967     static {
1968         vectorNode(VECTOR_CAST_L2B, "VectorCastL2X", TYPE_BYTE);
1969     }
1970 
1971     public static final String VECTOR_CAST_L2S = VECTOR_PREFIX + "VECTOR_CAST_L2S" + POSTFIX;
1972     static {
1973         vectorNode(VECTOR_CAST_L2S, "VectorCastL2X", TYPE_SHORT);
1974     }
1975 
1976     public static final String VECTOR_CAST_L2I = VECTOR_PREFIX + "VECTOR_CAST_L2I" + POSTFIX;
1977     static {
1978         vectorNode(VECTOR_CAST_L2I, "VectorCastL2X", TYPE_INT);
1979     }
1980 
1981     public static final String VECTOR_CAST_L2F = VECTOR_PREFIX + "VECTOR_CAST_L2F" + POSTFIX;
1982     static {
1983         vectorNode(VECTOR_CAST_L2F, "VectorCastL2X", TYPE_FLOAT);
1984     }
1985 
1986     public static final String VECTOR_CAST_L2D = VECTOR_PREFIX + "VECTOR_CAST_L2D" + POSTFIX;
1987     static {
1988         vectorNode(VECTOR_CAST_L2D, "VectorCastL2X", TYPE_DOUBLE);
1989     }
1990 
1991     public static final String VECTOR_CAST_S2B = VECTOR_PREFIX + "VECTOR_CAST_S2B" + POSTFIX;
1992     static {
1993         vectorNode(VECTOR_CAST_S2B, "VectorCastS2X", TYPE_BYTE);
1994     }
1995 
1996     public static final String VECTOR_CAST_S2I = VECTOR_PREFIX + "VECTOR_CAST_S2I" + POSTFIX;
1997     static {
1998         vectorNode(VECTOR_CAST_S2I, "VectorCastS2X", TYPE_INT);
1999     }
2000 
2001     public static final String VECTOR_CAST_S2L = VECTOR_PREFIX + "VECTOR_CAST_S2L" + POSTFIX;
2002     static {
2003         vectorNode(VECTOR_CAST_S2L, "VectorCastS2X", TYPE_LONG);
2004     }
2005 
2006     public static final String VECTOR_CAST_S2F = VECTOR_PREFIX + "VECTOR_CAST_S2F" + POSTFIX;
2007     static {
2008         vectorNode(VECTOR_CAST_S2F, "VectorCastS2X", TYPE_FLOAT);
2009     }
2010 
2011     public static final String VECTOR_CAST_S2D = VECTOR_PREFIX + "VECTOR_CAST_S2D" + POSTFIX;
2012     static {
2013         vectorNode(VECTOR_CAST_S2D, "VectorCastS2X", TYPE_DOUBLE);
2014     }
2015 
2016     public static final String VECTOR_CAST_F2HF = VECTOR_PREFIX + "VECTOR_CAST_F2HF" + POSTFIX;
2017     static {
2018         vectorNode(VECTOR_CAST_F2HF, "VectorCastF2HF", TYPE_SHORT);
2019     }
2020 
2021     public static final String VECTOR_CAST_HF2F = VECTOR_PREFIX + "VECTOR_CAST_HF2F" + POSTFIX;
2022     static {
2023         vectorNode(VECTOR_CAST_HF2F, "VectorCastHF2F", TYPE_FLOAT);
2024     }
2025 
2026     public static final String VECTOR_MASK_CAST = PREFIX + "VECTOR_MASK_CAST" + POSTFIX;
2027     static {
2028         beforeMatchingNameRegex(VECTOR_MASK_CAST, "VectorMaskCast");
2029     }
2030 
2031     public static final String VECTOR_REINTERPRET = PREFIX + "VECTOR_REINTERPRET" + POSTFIX;
2032     static {
2033         beforeMatchingNameRegex(VECTOR_REINTERPRET, "VectorReinterpret");
2034     }
2035 
2036     public static final String VECTOR_UCAST_B2S = VECTOR_PREFIX + "VECTOR_UCAST_B2S" + POSTFIX;
2037     static {
2038         vectorNode(VECTOR_UCAST_B2S, "VectorUCastB2X", TYPE_SHORT);
2039     }
2040 
2041     public static final String VECTOR_UCAST_B2I = VECTOR_PREFIX + "VECTOR_UCAST_B2I" + POSTFIX;
2042     static {
2043         vectorNode(VECTOR_UCAST_B2I, "VectorUCastB2X", TYPE_INT);
2044     }
2045 
2046     public static final String VECTOR_UCAST_B2L = VECTOR_PREFIX + "VECTOR_UCAST_B2L" + POSTFIX;
2047     static {
2048         vectorNode(VECTOR_UCAST_B2L, "VectorUCastB2X", TYPE_LONG);
2049     }
2050 
2051     public static final String VECTOR_UCAST_I2L = VECTOR_PREFIX + "VECTOR_UCAST_I2L" + POSTFIX;
2052     static {
2053         vectorNode(VECTOR_UCAST_I2L, "VectorUCastI2X", TYPE_LONG);
2054     }
2055 
2056     public static final String VECTOR_UCAST_S2I = VECTOR_PREFIX + "VECTOR_UCAST_S2I" + POSTFIX;
2057     static {
2058         vectorNode(VECTOR_UCAST_S2I, "VectorUCastS2X", TYPE_INT);
2059     }
2060 
2061     public static final String VECTOR_UCAST_S2L = VECTOR_PREFIX + "VECTOR_UCAST_S2L" + POSTFIX;
2062     static {
2063         vectorNode(VECTOR_UCAST_S2L, "VectorUCastS2X", TYPE_LONG);
2064     }
2065 
2066     public static final String VECTOR_TEST = PREFIX + "VECTOR_TEST" + POSTFIX;
2067     static {
2068         beforeMatchingNameRegex(VECTOR_TEST, "VectorTest");
2069     }
2070 
2071     public static final String VFABD = PREFIX + "VFABD" + POSTFIX;
2072     static {
2073         machOnlyNameRegex(VFABD, "vfabd");
2074     }
2075 
2076     public static final String VFABD_MASKED = PREFIX + "VFABD_MASKED" + POSTFIX;
2077     static {
2078         machOnlyNameRegex(VFABD_MASKED, "vfabd_masked");
2079     }
2080 
2081     public static final String VFMSB_MASKED = PREFIX + "VFMSB_MASKED" + POSTFIX;
2082     static {
2083         machOnlyNameRegex(VFMSB_MASKED, "vfmsb_masked");
2084     }
2085 
2086     public static final String VFNMAD_MASKED = PREFIX + "VFNMAD_MASKED" + POSTFIX;
2087     static {
2088         machOnlyNameRegex(VFNMAD_MASKED, "vfnmad_masked");
2089     }
2090 
2091     public static final String VFNMSB_MASKED = PREFIX + "VFNMSB_MASKED" + POSTFIX;
2092     static {
2093         machOnlyNameRegex(VFNMSB_MASKED, "vfnmsb_masked");
2094     }
2095 
2096     public static final String VFMAD_MASKED = PREFIX + "VFMAD_MASKED" + POSTFIX;
2097     static {
2098         machOnlyNameRegex(VFMAD_MASKED, "vfmad_masked");
2099     }
2100 
2101     public static final String VMASK_AND_NOT_L = PREFIX + "VMASK_AND_NOT_L" + POSTFIX;
2102     static {
2103         machOnlyNameRegex(VMASK_AND_NOT_L, "vmask_and_notL");
2104     }
2105 
2106     public static final String VMLA = PREFIX + "VMLA" + POSTFIX;
2107     static {
2108         machOnlyNameRegex(VMLA, "vmla");
2109     }
2110 
2111     public static final String VMLA_MASKED = PREFIX + "VMLA_MASKED" + POSTFIX;
2112     static {
2113         machOnlyNameRegex(VMLA_MASKED, "vmla_masked");
2114     }
2115 
2116     public static final String FMSUB = PREFIX + "FMSUB" + POSTFIX;
2117     static {
2118         machOnlyNameRegex(FMSUB, "msub(F|D)_reg_reg");
2119     }
2120 
2121     public static final String FNMADD = PREFIX + "FNMADD" + POSTFIX;
2122     static {
2123         machOnlyNameRegex(FNMADD, "mnadd(F|D)_reg_reg");
2124     }
2125 
2126     public static final String FNMSUB = PREFIX + "FNMSUB" + POSTFIX;
2127     static {
2128         machOnlyNameRegex(FNMSUB, "mnsub(F|D)_reg_reg");
2129     }
2130 
2131     public static final String VFMLA = PREFIX + "VFMLA" + POSTFIX;
2132     static {
2133         machOnlyNameRegex(VFMLA, "vfmla");
2134     }
2135 
2136     public static final String VFMLS = PREFIX + "VFMLS" + POSTFIX;
2137     static {
2138         machOnlyNameRegex(VFMLS, "vfmls");
2139     }
2140 
2141     public static final String VFNMLA = PREFIX + "VFNMLA" + POSTFIX;
2142     static {
2143         machOnlyNameRegex(VFNMLA, "vfnmla");
2144     }
2145 
2146     public static final String VMLS = PREFIX + "VMLS" + POSTFIX;
2147     static {
2148         machOnlyNameRegex(VMLS, "vmls");
2149     }
2150 
2151     public static final String VMLS_MASKED = PREFIX + "VMLS_MASKED" + POSTFIX;
2152     static {
2153         machOnlyNameRegex(VMLS_MASKED, "vmls_masked");
2154     }
2155 
2156     public static final String VMASK_CMP_ZERO_I_NEON = PREFIX + "VMASK_CMP_ZERO_I_NEON" + POSTFIX;
2157     static {
2158         machOnlyNameRegex(VMASK_CMP_ZERO_I_NEON, "vmaskcmp_zeroI_neon");
2159     }
2160 
2161     public static final String VMASK_CMP_ZERO_L_NEON = PREFIX + "VMASK_CMP_ZERO_L_NEON" + POSTFIX;
2162     static {
2163         machOnlyNameRegex(VMASK_CMP_ZERO_L_NEON, "vmaskcmp_zeroL_neon");
2164     }
2165 
2166     public static final String VMASK_CMP_ZERO_F_NEON = PREFIX + "VMASK_CMP_ZERO_F_NEON" + POSTFIX;
2167     static {
2168         machOnlyNameRegex(VMASK_CMP_ZERO_F_NEON, "vmaskcmp_zeroF_neon");
2169     }
2170 
2171     public static final String VMASK_CMP_ZERO_D_NEON = PREFIX + "VMASK_CMP_ZERO_D_NEON" + POSTFIX;
2172     static {
2173         machOnlyNameRegex(VMASK_CMP_ZERO_D_NEON, "vmaskcmp_zeroD_neon");
2174     }
2175 
2176     public static final String VMASK_CMP_IMM_I_SVE = PREFIX + "VMASK_CMP_IMM_I_SVE" + POSTFIX;
2177     static {
2178         machOnlyNameRegex(VMASK_CMP_IMM_I_SVE, "vmaskcmp_immI_sve");
2179     }
2180 
2181     public static final String VMASK_CMPU_IMM_I_SVE = PREFIX + "VMASK_CMPU_IMM_I_SVE" + POSTFIX;
2182     static {
2183         machOnlyNameRegex(VMASK_CMPU_IMM_I_SVE, "vmaskcmpU_immI_sve");
2184     }
2185 
2186     public static final String VMASK_CMP_IMM_L_SVE = PREFIX + "VMASK_CMP_IMM_L_SVE" + POSTFIX;
2187     static {
2188         machOnlyNameRegex(VMASK_CMP_IMM_L_SVE, "vmaskcmp_immL_sve");
2189     }
2190 
2191     public static final String VMASK_CMPU_IMM_L_SVE = PREFIX + "VMASK_CMPU_IMM_L_SVE" + POSTFIX;
2192     static {
2193         machOnlyNameRegex(VMASK_CMPU_IMM_L_SVE, "vmaskcmpU_immL_sve");
2194     }
2195 
2196     public static final String VNOT_I_MASKED = PREFIX + "VNOT_I_MASKED" + POSTFIX;
2197     static {
2198         machOnlyNameRegex(VNOT_I_MASKED, "vnotI_masked");
2199     }
2200 
2201     public static final String VNOT_L_MASKED = PREFIX + "VNOT_L_MASKED" + POSTFIX;
2202     static {
2203         machOnlyNameRegex(VNOT_L_MASKED, "vnotL_masked");
2204     }
2205 
2206     public static final String VSTOREMASK_TRUECOUNT = PREFIX + "VSTOREMASK_TRUECOUNT" + POSTFIX;
2207     static {
2208         machOnlyNameRegex(VSTOREMASK_TRUECOUNT, "vstoremask_truecount_neon");
2209     }
2210 
2211     public static final String XOR = PREFIX + "XOR" + POSTFIX;
2212     static {
2213         beforeMatchingNameRegex(XOR, "Xor(I|L)");
2214     }
2215 
2216     public static final String XOR_I = PREFIX + "XOR_I" + POSTFIX;
2217     static {
2218         beforeMatchingNameRegex(XOR_I, "XorI");
2219     }
2220 
2221     public static final String XOR_L = PREFIX + "XOR_L" + POSTFIX;
2222     static {
2223         beforeMatchingNameRegex(XOR_L, "XorL");
2224     }
2225 
2226     public static final String XOR_VB = VECTOR_PREFIX + "XOR_VB" + POSTFIX;
2227     static {
2228         vectorNode(XOR_VB, "XorV", TYPE_BYTE);
2229     }
2230 
2231     public static final String XOR_VS = VECTOR_PREFIX + "XOR_VS" + POSTFIX;
2232     static {
2233         vectorNode(XOR_VS, "XorV", TYPE_SHORT);
2234     }
2235 
2236     public static final String XOR_VI = VECTOR_PREFIX + "XOR_VI" + POSTFIX;
2237     static {
2238         vectorNode(XOR_VI, "XorV", TYPE_INT);
2239     }
2240 
2241     public static final String XOR_VL = VECTOR_PREFIX + "XOR_VL" + POSTFIX;
2242     static {
2243         vectorNode(XOR_VL, "XorV", TYPE_LONG);
2244     }
2245 
2246     public static final String XOR_V_MASK = PREFIX + "XOR_V_MASK" + POSTFIX;
2247     static {
2248         beforeMatchingNameRegex(XOR_V_MASK, "XorVMask");
2249     }
2250 
2251     public static final String XOR_REDUCTION_V = PREFIX + "XOR_REDUCTION_V" + POSTFIX;
2252     static {
2253         superWordNodes(XOR_REDUCTION_V, "XorReductionV");
2254     }
2255 
2256     public static final String XOR3_NEON = PREFIX + "XOR3_NEON" + POSTFIX;
2257     static {
2258         machOnlyNameRegex(XOR3_NEON, "veor3_neon");
2259     }
2260 
2261     public static final String XOR3_SVE = PREFIX + "XOR3_SVE" + POSTFIX;
2262     static {
2263         machOnlyNameRegex(XOR3_SVE, "veor3_sve");
2264     }
2265 
2266     public static final String COMPRESS_BITS_VI = VECTOR_PREFIX + "COMPRESS_BITS_VI" + POSTFIX;
2267     static {
2268         vectorNode(COMPRESS_BITS_VI, "CompressBitsV", TYPE_INT);
2269     }
2270 
2271     public static final String COMPRESS_BITS_VL = VECTOR_PREFIX + "COMPRESS_BITS_VL" + POSTFIX;
2272     static {
2273         vectorNode(COMPRESS_BITS_VL, "CompressBitsV", TYPE_LONG);
2274     }
2275 
2276     public static final String EXPAND_BITS_VI = VECTOR_PREFIX + "EXPAND_BITS_VI" + POSTFIX;
2277     static {
2278         vectorNode(EXPAND_BITS_VI, "ExpandBitsV", TYPE_INT);
2279     }
2280 
2281     public static final String EXPAND_BITS_VL = VECTOR_PREFIX + "EXPAND_BITS_VL" + POSTFIX;
2282     static {
2283         vectorNode(EXPAND_BITS_VL, "ExpandBitsV", TYPE_LONG);
2284     }
2285 
2286     public static final String Z_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX;
2287     static {
2288         String regex = START + "zLoadP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
2289         machOnly(Z_LOAD_P_WITH_BARRIER_FLAG, regex);
2290     }
2291 
2292     public static final String Z_STORE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_STORE_P_WITH_BARRIER_FLAG" + POSTFIX;
2293     static {
2294         String regex = START + "zStoreP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
2295         machOnly(Z_STORE_P_WITH_BARRIER_FLAG, regex);
2296     }
2297 
2298     public static final String Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG" + POSTFIX;
2299     static {
2300         String regex = START + "zCompareAndSwapP" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
2301         machOnly(Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, regex);
2302     }
2303 
2304     public static final String Z_GET_AND_SET_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_GET_AND_SET_P_WITH_BARRIER_FLAG" + POSTFIX;
2305     static {
2306         String regex = START + "(zXChgP)|(zGetAndSetP\\S*)" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
2307         machOnly(Z_GET_AND_SET_P_WITH_BARRIER_FLAG, regex);
2308     }
2309 
2310     public static final String X86_LOCK_ADDB_REG = PREFIX + "X86_LOCK_ADDB_REG" + POSTFIX;
2311     static {
2312         machOnlyNameRegex(X86_LOCK_ADDB_REG, "xaddB_reg_no_res");
2313     }
2314 
2315     public static final String X86_LOCK_ADDB_IMM = PREFIX + "X86_LOCK_ADDB_IMM" + POSTFIX;
2316     static {
2317         machOnlyNameRegex(X86_LOCK_ADDB_IMM, "xaddB_imm_no_res");
2318     }
2319 
2320     public static final String X86_LOCK_XADDB = PREFIX + "X86_LOCK_XADDB" + POSTFIX;
2321     static {
2322         machOnlyNameRegex(X86_LOCK_XADDB, "xaddB");
2323     }
2324 
2325     public static final String X86_LOCK_ADDS_REG = PREFIX + "X86_LOCK_ADDS_REG" + POSTFIX;
2326     static {
2327         machOnlyNameRegex(X86_LOCK_ADDS_REG, "xaddS_reg_no_res");
2328     }
2329 
2330     public static final String X86_LOCK_ADDS_IMM = PREFIX + "X86_LOCK_ADDS_IMM" + POSTFIX;
2331     static {
2332         machOnlyNameRegex(X86_LOCK_ADDS_IMM, "xaddS_imm_no_res");
2333     }
2334 
2335     public static final String X86_LOCK_XADDS = PREFIX + "X86_LOCK_XADDS" + POSTFIX;
2336     static {
2337         machOnlyNameRegex(X86_LOCK_XADDS, "xaddS");
2338     }
2339 
2340     public static final String X86_LOCK_ADDI_REG = PREFIX + "X86_LOCK_ADDI_REG" + POSTFIX;
2341     static {
2342         machOnlyNameRegex(X86_LOCK_ADDI_REG, "xaddI_reg_no_res");
2343     }
2344 
2345     public static final String X86_LOCK_ADDI_IMM = PREFIX + "X86_LOCK_ADDI_IMM" + POSTFIX;
2346     static {
2347         machOnlyNameRegex(X86_LOCK_ADDI_IMM, "xaddI_imm_no_res");
2348     }
2349 
2350     public static final String X86_LOCK_XADDI = PREFIX + "X86_LOCK_XADDI" + POSTFIX;
2351     static {
2352         machOnlyNameRegex(X86_LOCK_XADDI, "xaddI");
2353     }
2354 
2355     public static final String X86_LOCK_ADDL_REG = PREFIX + "X86_LOCK_ADDL_REG" + POSTFIX;
2356     static {
2357         machOnlyNameRegex(X86_LOCK_ADDL_REG, "xaddL_reg_no_res");
2358     }
2359 
2360     public static final String X86_LOCK_ADDL_IMM = PREFIX + "X86_LOCK_ADDL_IMM" + POSTFIX;
2361     static {
2362         machOnlyNameRegex(X86_LOCK_ADDL_IMM, "xaddL_imm_no_res");
2363     }
2364 
2365     public static final String X86_LOCK_XADDL = PREFIX + "X86_LOCK_XADDL" + POSTFIX;
2366     static {
2367         machOnlyNameRegex(X86_LOCK_XADDL, "xaddL");
2368     }
2369 
2370     public static final String X86_TESTI_REG = PREFIX + "X86_TESTI_REG" + POSTFIX;
2371     static {
2372         machOnlyNameRegex(X86_TESTI_REG, "testI_reg");
2373     }
2374 
2375     public static final String X86_TESTL_REG = PREFIX + "X86_TESTL_REG" + POSTFIX;
2376     static {
2377         machOnlyNameRegex(X86_TESTL_REG, "testL_reg");
2378     }
2379 
2380     public static final String X86_CMOVEL_IMM01 = PREFIX + "X86_CMOVEL_IMM01" + POSTFIX;
2381     static {
2382         machOnlyNameRegex(X86_CMOVEL_IMM01, "cmovL_imm_01");
2383     }
2384 
2385     public static final String X86_CMOVEL_IMM01U = PREFIX + "X86_CMOVEL_IMM01U" + POSTFIX;
2386     static {
2387         machOnlyNameRegex(X86_CMOVEL_IMM01U, "cmovL_imm_01U");
2388     }
2389 
2390     public static final String X86_CMOVEL_IMM01UCF = PREFIX + "X86_CMOVEL_IMM01UCF" + POSTFIX;
2391     static {
2392         machOnlyNameRegex(X86_CMOVEL_IMM01UCF, "cmovL_imm_01UCF");
2393     }
2394 
2395     /*
2396      * Utility methods to set up IR_NODE_MAPPINGS.
2397      */
2398 
2399     /**
2400      * Apply {@code regex} on all machine independent ideal graph phases up to and including
2401      * {@link CompilePhase#BEFORE_MATCHING}.
2402      */
2403     public static void beforeMatching(String irNodePlaceholder, String regex) {
2404         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
2405     }
2406 
2407     /**
2408      * Apply {@code irNodeRegex} as regex for the IR node name on all machine independent ideal graph phases up to and
2409      * including {@link CompilePhase#BEFORE_MATCHING}.
2410      */
2411     private static void beforeMatchingNameRegex(String irNodePlaceholder, String irNodeRegex) {
2412         String regex = START + irNodeRegex + MID + END;
2413         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
2414     }
2415 
2416     /**
2417      * Apply {@code irNodeRegex} as regex for the IR vector node name on all machine independent ideal graph phases up to and
2418      * including {@link CompilePhase#BEFORE_MATCHING}. Since this is a vector node, we can also check the vector element
2419      * type {@code typeString} and the vector size (number of elements), {@see VECTOR_SIZE}.
2420      */
2421     private static void vectorNode(String irNodePlaceholder, String irNodeRegex, String typeString) {
2422         TestFramework.check(isVectorIRNode(irNodePlaceholder), "vectorNode: failed prefix check for irNodePlaceholder "
2423                                                                + irNodePlaceholder + " -> did you use VECTOR_PREFIX?");
2424         // IS_REPLACED is later replaced with the specific type and size of the vector.
2425         String regex = START + irNodeRegex + MID  + IS_REPLACED + END;
2426         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
2427         VECTOR_NODE_TYPE.put(irNodePlaceholder, typeString);
2428     }
2429 
2430     private static void allocNodes(String irNode, String irNodeName, String optoRegex) {
2431         String idealIndependentRegex = START + irNodeName + "\\b" + MID + END;
2432         Map<PhaseInterval, String> intervalToRegexMap = new HashMap<>();
2433         intervalToRegexMap.put(new PhaseInterval(CompilePhase.BEFORE_REMOVEUSELESS, CompilePhase.PHASEIDEALLOOP_ITERATIONS),
2434                                idealIndependentRegex);
2435         intervalToRegexMap.put(new PhaseInterval(CompilePhase.PRINT_OPTO_ASSEMBLY), optoRegex);
2436         MultiPhaseRangeEntry entry = new MultiPhaseRangeEntry(CompilePhase.PRINT_OPTO_ASSEMBLY, intervalToRegexMap);
2437         IR_NODE_MAPPINGS.put(irNode, entry);
2438     }
2439 
2440     private static void callOfNodes(String irNodePlaceholder, String callRegex) {
2441         String regex = START + callRegex + MID + IS_REPLACED + " " +  END;
2442         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
2443     }
2444 
2445     /**
2446      * Apply {@code regex} on all machine dependant ideal graph phases (i.e. on the mach graph) starting from
2447      * {@link CompilePhase#MATCHING}.
2448      */
2449     public static void optoOnly(String irNodePlaceholder, String regex) {
2450         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.OPTO_ASSEMBLY, regex));
2451     }
2452 
2453     private static void machOnly(String irNodePlaceholder, String regex) {
2454         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.MACH, regex));
2455     }
2456 
2457     private static void machOnlyNameRegex(String irNodePlaceholder, String irNodeRegex) {
2458         String regex = START + irNodeRegex + MID + END;
2459         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.MACH, regex));
2460     }
2461 
2462     /**
2463      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#AFTER_CLOOPS}.
2464      */
2465     private static void fromAfterCountedLoops(String irNodePlaceholder, String regex) {
2466         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
2467                                                                           CompilePhase.AFTER_CLOOPS,
2468                                                                           CompilePhase.FINAL_CODE));
2469     }
2470 
2471     /**
2472      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS}.
2473      */
2474     private static void fromBeforeCountedLoops(String irNodePlaceholder, String regex) {
2475         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
2476                                                                           CompilePhase.BEFORE_CLOOPS,
2477                                                                           CompilePhase.FINAL_CODE));
2478     }
2479 
2480     /**
2481      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS} up to and
2482      * including {@link CompilePhase#BEFORE_MATCHING}
2483      */
2484     private static void fromMacroToBeforeMatching(String irNodePlaceholder, String regex) {
2485         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
2486                                                                           CompilePhase.AFTER_MACRO_EXPANSION,
2487                                                                           CompilePhase.BEFORE_MATCHING));
2488     }
2489 
2490     /**
2491      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS} up to and
2492      * including {@link CompilePhase#BEFORE_MATCHING}
2493      */
2494     private static void afterBarrierExpansionToBeforeMatching(String irNodePlaceholder, String regex) {
2495         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
2496                                                                           CompilePhase.OPTIMIZE_FINISHED,
2497                                                                           CompilePhase.BEFORE_MATCHING));
2498     }
2499 
2500     /**
2501      * Apply a regex that matches a macro node IR node name {@code macroNodeName} exactly on all machine independent
2502      * ideal graph phases up to and including {@link CompilePhase#BEFORE_MACRO_EXPANSION}. By default, we match on
2503      * {@link CompilePhase#BEFORE_MACRO_EXPANSION} when no {@link CompilePhase} is chosen.
2504      */
2505     private static void macroNodes(String irNodePlaceholder, String macroNodeName) {
2506         String macroNodeRegex = START + macroNodeName + "\\b" + MID + END;
2507         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.BEFORE_MACRO_EXPANSION,
2508                                                                           macroNodeRegex,
2509                                                                           CompilePhase.BEFORE_STRINGOPTS,
2510                                                                           CompilePhase.BEFORE_MACRO_EXPANSION));
2511     }
2512 
2513     private static void trapNodes(String irNodePlaceholder, String trapReason) {
2514         String regex = START + "CallStaticJava" + MID + "uncommon_trap.*" + trapReason + END;
2515         beforeMatching(irNodePlaceholder, regex);
2516     }
2517 
2518     private static void loadOfNodes(String irNodePlaceholder, String irNodeRegex) {
2519         String regex = START + irNodeRegex + MID + "@\\S*" + IS_REPLACED + LOAD_OF_CLASS_POSTFIX;
2520         beforeMatching(irNodePlaceholder, regex);
2521     }
2522 
2523     private static void storeOfNodes(String irNodePlaceholder, String irNodeRegex) {
2524         String regex = START + irNodeRegex + MID + "@\\S*" + IS_REPLACED + STORE_OF_CLASS_POSTFIX;
2525         beforeMatching(irNodePlaceholder, regex);
2526     }
2527 
2528     /**
2529      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#PHASEIDEALLOOP1} which is the
2530      * first phase that could contain vector nodes from super word.
2531      */
2532     private static void superWordNodes(String irNodePlaceholder, String irNodeRegex) {
2533         String regex = START + irNodeRegex + MID + END;
2534         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
2535                                                                           CompilePhase.PHASEIDEALLOOP1,
2536                                                                           CompilePhase.BEFORE_MATCHING));
2537     }
2538 
2539 
2540     /*
2541      * Methods used internally by the IR framework.
2542      */
2543 
2544     /**
2545      * Is {@code irNodeString} an IR node placeholder string?
2546      */
2547     public static boolean isIRNode(String irNodeString) {
2548         return irNodeString.startsWith(PREFIX);
2549     }
2550 
2551     /**
2552      * Is {@code irCompositeNodeString} an IR composite node placeholder string?
2553      */
2554     public static boolean isCompositeIRNode(String irCompositeNodeString) {
2555         return irCompositeNodeString.startsWith(COMPOSITE_PREFIX);
2556     }
2557 
2558     /**
2559      * Is {@code irVectorNodeString} an IR vector node placeholder string?
2560      */
2561     public static boolean isVectorIRNode(String irVectorNodeString) {
2562         return irVectorNodeString.startsWith(VECTOR_PREFIX);
2563     }
2564 
2565     /**
2566      * Is {@code irVectorSizeString} a vector size string?
2567      */
2568     public static boolean isVectorSize(String irVectorSizeString) {
2569         return irVectorSizeString.startsWith(VECTOR_SIZE);
2570     }
2571 
2572     /**
2573      * Parse {@code sizeString} and generate a regex pattern to match for the size in the IR dump.
2574      */
2575     public static String parseVectorNodeSize(String sizeString, String typeString, VMInfo vmInfo) {
2576         if (sizeString.equals(VECTOR_SIZE_TAG_ANY)) {
2577             return "\\\\d+"; // match with any number
2578         }
2579         // Try to parse any tags, convert to comma separated list of ints
2580         sizeString = parseVectorNodeSizeTag(sizeString, typeString, vmInfo);
2581         // Parse comma separated list of numbers
2582         String[] sizes = sizeString.split(",");
2583         String regex = "";
2584         for (int i = 0; i < sizes.length; i++) {
2585             int size = 0;
2586             try {
2587                 size = Integer.parseInt(sizes[i]);
2588             } catch (NumberFormatException e) {
2589                 throw new TestFormatException("Vector node has invalid size \"" + sizes[i] + "\", in \"" + sizeString + "\"");
2590             }
2591             TestFormat.checkNoReport(size > 1, "Vector node size must be 2 or larger, but got \"" + sizes[i] + "\", in \"" + sizeString + "\"");
2592             regex += ((i > 0) ? "|" : "") + size;
2593         }
2594         if (sizes.length > 1) {
2595            regex = "(" + regex + ")";
2596         }
2597         return regex;
2598     }
2599 
2600     /**
2601      * If {@code sizeTagString} is a size tag, return the list of accepted sizes, else return sizeTagString.
2602      */
2603     public static String parseVectorNodeSizeTag(String sizeTagString, String typeString, VMInfo vmInfo) {
2604         // Parse out "min(a,b,c,...)"
2605         if (sizeTagString.startsWith("min(") && sizeTagString.endsWith(")")) {
2606             return parseVectorNodeSizeTagMin(sizeTagString, typeString, vmInfo);
2607         }
2608 
2609         // Parse individual tags
2610         return switch (sizeTagString) {
2611             case VECTOR_SIZE_TAG_MAX -> String.valueOf(getMaxElementsForType(typeString, vmInfo));
2612             case "max_byte"          -> String.valueOf(getMaxElementsForType(TYPE_BYTE, vmInfo));
2613             case "max_char"          -> String.valueOf(getMaxElementsForType(TYPE_CHAR, vmInfo));
2614             case "max_short"         -> String.valueOf(getMaxElementsForType(TYPE_SHORT, vmInfo));
2615             case "max_int"           -> String.valueOf(getMaxElementsForType(TYPE_INT, vmInfo));
2616             case "max_long"          -> String.valueOf(getMaxElementsForType(TYPE_LONG, vmInfo));
2617             case "max_float"         -> String.valueOf(getMaxElementsForType(TYPE_FLOAT, vmInfo));
2618             case "max_double"        -> String.valueOf(getMaxElementsForType(TYPE_DOUBLE, vmInfo));
2619             case "LoopMaxUnroll"     -> String.valueOf(vmInfo.getLongValue("LoopMaxUnroll"));
2620             default                  -> sizeTagString;
2621         };
2622     }
2623 
2624     /**
2625      * Parse {@code sizeTagString}, which must be a min-clause.
2626      */
2627     public static String parseVectorNodeSizeTagMin(String sizeTagString, String typeString, VMInfo vmInfo) {
2628         String[] tags = sizeTagString.substring(4, sizeTagString.length() - 1).split(",");
2629         TestFormat.checkNoReport(tags.length > 1, "Vector node size \"min(...)\" must have at least 2 comma separated arguments, got \"" + sizeTagString + "\"");
2630         int minVal = 1024;
2631         for (int i = 0; i < tags.length; i++) {
2632             String tag = parseVectorNodeSizeTag(tags[i].trim(), typeString, vmInfo);
2633             int tag_val = 0;
2634             try {
2635                 tag_val = Integer.parseInt(tag);
2636             } catch (NumberFormatException e) {
2637                 throw new TestFormatException("Vector node has invalid size in \"min(...)\", argument " + i + ", \"" + tag + "\", in \"" + sizeTagString + "\"");
2638             }
2639             minVal = Math.min(minVal, tag_val);
2640         }
2641         return String.valueOf(minVal);
2642     }
2643 
2644     /**
2645      * Return maximal number of elements that can fit in a vector of the specified type.
2646      */
2647     public static long getMaxElementsForType(String typeString, VMInfo vmInfo) {
2648         long maxVectorSize = vmInfo.getLongValue("MaxVectorSize");
2649         TestFormat.checkNoReport(maxVectorSize > 0, "VMInfo: MaxVectorSize is not larger than zero");
2650         long maxBytes = maxVectorSize;
2651 
2652         if (Platform.isX64() || Platform.isX86()) {
2653             maxBytes = Math.min(maxBytes, getMaxElementsForTypeOnX86(typeString, vmInfo));
2654         }
2655 
2656         // compute elements per vector: vector bytes divided by bytes per element
2657         int bytes = getTypeSizeInBytes(typeString);
2658         return maxBytes / bytes;
2659     }
2660 
2661     /**
2662      * Return maximal number of elements that can fit in a vector of the specified type, on x86 / x64.
2663      */
2664     public static long getMaxElementsForTypeOnX86(String typeString, VMInfo vmInfo) {
2665         // restrict maxBytes for specific features, see Matcher::vector_width_in_bytes in x86.ad:
2666         boolean avx1 = vmInfo.hasCPUFeature("avx");
2667         boolean avx2 = vmInfo.hasCPUFeature("avx2");
2668         boolean avx512 = vmInfo.hasCPUFeature("avx512f");
2669         boolean avx512bw = vmInfo.hasCPUFeature("avx512bw");
2670         long maxBytes;
2671         if (avx512) {
2672             maxBytes = 64;
2673         } else if (avx2) {
2674             maxBytes = 32;
2675         } else {
2676             maxBytes = 16;
2677         }
2678         if (avx1 && (typeString.equals(TYPE_FLOAT) || typeString.equals(TYPE_DOUBLE))) {
2679             maxBytes = avx512 ? 64 : 32;
2680         }
2681         if (avx512 && (typeString.equals(TYPE_BYTE) || typeString.equals(TYPE_SHORT) || typeString.equals(TYPE_CHAR))) {
2682             maxBytes = avx512bw ? 64 : 32;
2683         }
2684 
2685         return maxBytes;
2686     }
2687 
2688     /**
2689      * Return size in bytes of type named by {@code typeString}, return 0 if it does not name a type.
2690      */
2691     public static int getTypeSizeInBytes(String typeString) {
2692         return switch (typeString) {
2693             case TYPE_BYTE              -> 1;
2694             case TYPE_CHAR, TYPE_SHORT  -> 2;
2695             case TYPE_INT, TYPE_FLOAT   -> 4;
2696             case TYPE_LONG, TYPE_DOUBLE -> 8;
2697             default                     -> 0;
2698         };
2699     }
2700 
2701     /**
2702      * Returns "IRNode.XYZ", where XYZ is one of the IR node placeholder variable names defined above.
2703      */
2704     public static String getIRNodeAccessString(String irNodeString) {
2705         int prefixLength;
2706         if (isCompositeIRNode(irNodeString)) {
2707             TestFramework.check(irNodeString.length() > COMPOSITE_PREFIX.length() + POSTFIX.length(),
2708                                 "Invalid composite node placeholder: " + irNodeString);
2709             prefixLength = COMPOSITE_PREFIX.length();
2710         } else if (isVectorIRNode(irNodeString)) {
2711             TestFramework.check(irNodeString.length() > VECTOR_PREFIX.length() + POSTFIX.length(),
2712                                 "Invalid vector node placeholder: " + irNodeString);
2713             prefixLength = VECTOR_PREFIX.length();
2714         } else {
2715             prefixLength = PREFIX.length();
2716         }
2717         return "IRNode." + irNodeString.substring(prefixLength, irNodeString.length() - POSTFIX.length());
2718     }
2719 
2720     /**
2721      * Is this IR node supported on current platform, used VM build, etc.?
2722      * Throws a {@link CheckedTestFrameworkException} if the IR node is unsupported.
2723      */
2724     public static void checkIRNodeSupported(String node) throws CheckedTestFrameworkException {
2725         switch (node) {
2726             case INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP -> {
2727                 if (!WhiteBox.getWhiteBox().isJVMCISupportedByGC()) {
2728                     throw new CheckedTestFrameworkException("INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP is unsupported " +
2729                                                             "in builds without JVMCI.");
2730                 }
2731             }
2732             case CHECKCAST_ARRAYCOPY -> {
2733                 if (Platform.isS390x()) {
2734                     throw new CheckedTestFrameworkException("CHECKCAST_ARRAYCOPY is unsupported on s390.");
2735                 }
2736             }
2737             case IS_FINITE_D, IS_FINITE_F -> {
2738                 if (!Platform.isRISCV64()) {
2739                     throw new CheckedTestFrameworkException("IS_FINITE_* is only supported on riscv64.");
2740                 }
2741             }
2742             // default: do nothing -> IR node is supported and can be used by the user.
2743         }
2744     }
2745 
2746     /**
2747      * Get the regex of an IR node for a specific compile phase. If {@code irNode} is not an IR node placeholder string
2748      * or if there is no regex specified for {@code compilePhase}, a {@link TestFormatException} is reported.
2749      */
2750     public static String getRegexForCompilePhase(String irNode, CompilePhase compilePhase) {
2751         IRNodeMapEntry entry = IR_NODE_MAPPINGS.get(irNode);
2752         String failMsg = "IR Node \"" + irNode + "\" defined in class IRNode has no regex/compiler phase mapping " +
2753                          "(i.e. no static initializer block that adds a mapping entry to IRNode.IR_NODE_MAPPINGS)." +
2754                          System.lineSeparator() +
2755                          "   Have you just created the entry \"" + irNode + "\" in class IRNode and forgot to add a " +
2756                          "mapping?" + System.lineSeparator() +
2757                          "   Violation";
2758         TestFormat.checkNoReport(entry != null, failMsg);
2759         String regex = entry.regexForCompilePhase(compilePhase);
2760         failMsg = "IR Node \"" + irNode + "\" defined in class IRNode has no regex defined for compile phase "
2761                   + compilePhase + "." + System.lineSeparator() +
2762                   "   If you think this compile phase should be supported, update the mapping for \"" + irNode +
2763                   "\" in class IRNode (i.e the static initializer block immediately following the definition of \"" +
2764                   irNode + "\")." + System.lineSeparator() +
2765                   "   Violation";
2766         TestFormat.checkNoReport(regex != null, failMsg);
2767         return regex;
2768     }
2769 
2770     /**
2771      * Get the default phase of an IR node. If {@code irNode} is not an IR node placeholder string, a
2772      * {@link TestFormatException} is reported.
2773      */
2774     public static CompilePhase getDefaultPhase(String irNode) {
2775         IRNodeMapEntry entry = IR_NODE_MAPPINGS.get(irNode);
2776         String failMsg = "\"" + irNode + "\" is not an IR node defined in class IRNode and " +
2777                          "has therefore no default compile phase specified." + System.lineSeparator() +
2778                          "   If your regex represents a C2 IR node, consider adding an entry to class IRNode together " +
2779                          "with a static initializer block that adds a mapping to IRNode.IR_NODE_MAPPINGS." +
2780                          System.lineSeparator() +
2781                          "   Otherwise, set the @IR \"phase\" attribute to a compile phase different from " +
2782                          "CompilePhase.DEFAULT to explicitly tell the IR framework on which compile phase your rule" +
2783                          " should be applied on." + System.lineSeparator() +
2784                          "   Violation";
2785         TestFormat.checkNoReport(entry != null, failMsg);
2786         return entry.defaultCompilePhase();
2787     }
2788 
2789     public static String getVectorNodeType(String irNode) {
2790         String typeString = VECTOR_NODE_TYPE.get(irNode);
2791         String failMsg = "\"" + irNode + "\" is not a Vector IR node defined in class IRNode";
2792         TestFormat.check(typeString != null, failMsg);
2793         return typeString;
2794     }
2795 }