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