1 /*
   2  * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package compiler.lib.ir_framework;
  25 
  26 import compiler.lib.ir_framework.driver.irmatching.mapping.*;
  27 import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo;
  28 import compiler.lib.ir_framework.shared.CheckedTestFrameworkException;
  29 import compiler.lib.ir_framework.shared.TestFormat;
  30 import compiler.lib.ir_framework.shared.TestFormatException;
  31 import compiler.valhalla.inlinetypes.InlineTypeIRNode;
  32 import jdk.test.lib.Platform;
  33 import jdk.test.whitebox.WhiteBox;
  34 
  35 import java.util.HashMap;
  36 import java.util.Map;
  37 
  38 /**
  39  * This class specifies IR node placeholder strings (also referred to as just "IR nodes") with mappings to regexes
  40  * depending on the selected compile phases. The mappings are stored in {@link #IR_NODE_MAPPINGS}. Each IR node
  41  * placeholder string is mapped to a {@link IRNodeMapEntry} instance defined in
  42  * {@link compiler.lib.ir_framework.driver.irmatching.mapping}.
  43  *
  44  * <p>
  45  * IR node placeholder strings can be used in {@link IR#failOn()} and/or {@link IR#counts()} attributes to define IR
  46  * constraints. They usually represent a single C2 IR node or a group of them.
  47  *
  48  * <p>
  49  * Each IR node placeholder string is accompanied by a static block that defines an IR node placeholder to regex(es)
  50  * mapping. The IR framework will automatically replace each IR node placeholder string in a user defined test with a
  51  * regex depending on the selected compile phases in {@link IR#phase} and the provided mapping.
  52  *
  53  * <p>
  54  * Each mapping must define a default compile phase which is applied when the user does not explicitly set the
  55  * {@link IR#phase()} attribute or when directly using {@link CompilePhase#DEFAULT}. In this case, the IR framework
  56  * falls back on the default compile phase of any {@link IRNodeMapEntry}.
  57  *
  58  * <p>
  59  * The IR framework reports a {@link TestFormatException} if:
  60  * <ul>
  61  *     <li><p> A user test specifies a compile phase for which no mapping is defined in this class.</li>
  62  *     <li><p> An IR node placeholder string is either missing a mapping or does not provide a regex for a specified
  63  *             compile phase in {@link IR#phase}.
  64  * </ul>
  65  *
  66  * <p>
  67  * There are two types of IR nodes:
  68  * <ul>
  69  *     <li><p>Normal IR nodes: The IR node placeholder string is directly replaced by a regex.</li>
  70  *     <li><p>Composite IR nodes:  The IR node placeholder string contains an additional {@link #COMPOSITE_PREFIX}.
  71  *                                 Using this IR node expects another user provided string in the constraint list of
  72  *                                 {@link IR#failOn()} and {@link IR#counts()}. They cannot be used as normal IR nodes.
  73  *                                 Trying to do so will result in a format violation error.</li>
  74  *     <li><p>Vector IR nodes:  The IR node placeholder string contains an additional {@link #VECTOR_PREFIX}.
  75  *                              Using this IR node, one can check for the type and size of a vector. The type must
  76  *                              be directly specified in {@link #vectorNode}. The size can be specified directly with
  77  *                              an additional argument using {@link #VECTOR_SIZE}, followed by a size tag or a comma
  78  *                              separated list of sizes. If the size argument is not given, then a default size of
  79  *                              {@link #VECTOR_SIZE_MAX} is taken, which is the number of elements that can fit in a
  80  *                              vector of the specified type (depends on the VM flag MaxVectorSize and CPU features).
  81  *                              However, when using {@link IR#failOn} or {@link IR#counts()} with comparison {@code <},
  82  *                              or {@code <=} or {@code =0}, the default size is {@link #VECTOR_SIZE_ANY}, allowing any
  83  *                              size. The motivation for these default values is that in most cases one wants to have
  84  *                              vectorization with maximal vector width, or no vectorization of any vector width.
  85  * </ul>
  86  */
  87 public class IRNode {
  88     /**
  89      * Prefix for normal IR nodes.
  90      */
  91     public static final String PREFIX = "_#";
  92     /**
  93      * Prefix for composite IR nodes.
  94      */
  95     private static final String COMPOSITE_PREFIX = PREFIX + "C#";
  96     /**
  97      * Prefix for vector IR nodes.
  98      */
  99     private static final String VECTOR_PREFIX = PREFIX + "V#";
 100 
 101     private static final String POSTFIX = "#_";
 102 
 103     public static final String START = "(\\d+(\\s){2}(";
 104     public static final String MID = ".*)+(\\s){2}===.*";
 105     public static final String END = ")";
 106 
 107     public static final String IS_REPLACED = "#IS_REPLACED#"; // Is replaced by an additional user-defined string.
 108 
 109     public static final String VECTOR_SIZE = "_@";
 110     public static final String VECTOR_SIZE_TAG_ANY = "any";
 111     public static final String VECTOR_SIZE_TAG_MAX = "max_for_type";
 112     public static final String VECTOR_SIZE_ANY = VECTOR_SIZE + VECTOR_SIZE_TAG_ANY; // default for counts "=0" and failOn
 113     public static final String VECTOR_SIZE_MAX = VECTOR_SIZE + VECTOR_SIZE_TAG_MAX; // default in counts
 114     public static final String VECTOR_SIZE_2   = VECTOR_SIZE + "2";
 115     public static final String VECTOR_SIZE_4   = VECTOR_SIZE + "4";
 116     public static final String VECTOR_SIZE_8   = VECTOR_SIZE + "8";
 117     public static final String VECTOR_SIZE_16  = VECTOR_SIZE + "16";
 118     public static final String VECTOR_SIZE_32  = VECTOR_SIZE + "32";
 119     public static final String VECTOR_SIZE_64  = VECTOR_SIZE + "64";
 120 
 121     private static final String TYPE_BYTE   = "B";
 122     private static final String TYPE_CHAR   = "C";
 123     private static final String TYPE_SHORT  = "S";
 124     private static final String TYPE_INT    = "I";
 125     private static final String TYPE_LONG   = "J";
 126     private static final String TYPE_FLOAT  = "F";
 127     private static final String TYPE_DOUBLE = "D";
 128 
 129     /**
 130      * IR placeholder string to regex-for-compile-phase map.
 131      */
 132     private static final Map<String, IRNodeMapEntry> IR_NODE_MAPPINGS = new HashMap<>();
 133 
 134     /**
 135      * Map every vectorNode to a type string.
 136      */
 137     private static final Map<String, String> VECTOR_NODE_TYPE = new HashMap<>();
 138 
 139     /*
 140      * Start of IR placeholder string definitions followed by a static block defining the regex-for-compile-phase mapping.
 141      * An IR node placeholder string must start with PREFIX for normal IR nodes or COMPOSITE_PREFIX for composite IR
 142      * nodes, or VECTOR_PREFIX for vector nodes (see class description above).
 143      *
 144      * An IR node definition looks like this:
 145      *
 146      * public static final String IR_NODE = [PREFIX|COMPOSITE_PREFIX|VECTOR_PREFIX] + "IR_NODE" + POSTFIX;
 147      * static {
 148      *    // Define IR_NODE to regex-for-compile-phase mapping. Create a new IRNodeMapEntry object and add it to
 149      *    // IR_NODE_MAPPINGS. This can be done by using the helper methods defined after all IR node placeholder string
 150      *    // definitions.
 151      * }
 152      */
 153 
 154     // Valhalla: Make sure that all Valhalla specific IR nodes are also properly initialized. Doing it here also
 155     //           ensures that the Flag VM is able to pick up the correct compile phases.
 156     static {
 157         InlineTypeIRNode.forceStaticInitialization();
 158     }
 159 
 160     public static final String ABS_D = PREFIX + "ABS_D" + POSTFIX;
 161     static {
 162         beforeMatchingNameRegex(ABS_D, "AbsD");
 163     }
 164 
 165     public static final String ABS_F = PREFIX + "ABS_F" + POSTFIX;
 166     static {
 167         beforeMatchingNameRegex(ABS_F, "AbsF");
 168     }
 169 
 170     public static final String ABS_I = PREFIX + "ABS_I" + POSTFIX;
 171     static {
 172         beforeMatchingNameRegex(ABS_I, "AbsI");
 173     }
 174 
 175     public static final String ABS_L = PREFIX + "ABS_L" + POSTFIX;
 176     static {
 177         beforeMatchingNameRegex(ABS_L, "AbsL");
 178     }
 179 
 180     public static final String ABS_VB = VECTOR_PREFIX + "ABS_VB" + POSTFIX;
 181     static {
 182         vectorNode(ABS_VB, "AbsVB", TYPE_BYTE);
 183     }
 184 
 185     // ABS_VC / AbsVC does not exist (char is 2 byte unsigned)
 186 
 187     public static final String ABS_VS = VECTOR_PREFIX + "ABS_VS" + POSTFIX;
 188     static {
 189         vectorNode(ABS_VS, "AbsVS", TYPE_SHORT);
 190     }
 191 
 192     public static final String ABS_VI = VECTOR_PREFIX + "ABS_VI" + POSTFIX;
 193     static {
 194         vectorNode(ABS_VI, "AbsVI", TYPE_INT);
 195     }
 196 
 197     public static final String ABS_VL = VECTOR_PREFIX + "ABS_VL" + POSTFIX;
 198     static {
 199         vectorNode(ABS_VL, "AbsVL", TYPE_LONG);
 200     }
 201 
 202     public static final String ABS_VF = VECTOR_PREFIX + "ABS_VF" + POSTFIX;
 203     static {
 204         vectorNode(ABS_VF, "AbsVF", TYPE_FLOAT);
 205     }
 206 
 207     public static final String ABS_VD = VECTOR_PREFIX + "ABS_VD" + POSTFIX;
 208     static {
 209         vectorNode(ABS_VD, "AbsVD", TYPE_DOUBLE);
 210     }
 211 
 212     public static final String ADD = PREFIX + "ADD" + POSTFIX;
 213     static {
 214         beforeMatchingNameRegex(ADD, "Add(I|L|F|D|P)");
 215     }
 216 
 217     public static final String ADD_F = PREFIX + "ADD_F" + POSTFIX;
 218     static {
 219         beforeMatchingNameRegex(ADD_F, "AddF");
 220     }
 221 
 222     public static final String ADD_I = PREFIX + "ADD_I" + POSTFIX;
 223     static {
 224         beforeMatchingNameRegex(ADD_I, "AddI");
 225     }
 226 
 227     public static final String ADD_L = PREFIX + "ADD_L" + POSTFIX;
 228     static {
 229         beforeMatchingNameRegex(ADD_L, "AddL");
 230     }
 231 
 232     public static final String ADD_HF = PREFIX + "ADD_HF" + POSTFIX;
 233     static {
 234         beforeMatchingNameRegex(ADD_HF, "AddHF");
 235     }
 236 
 237     public static final String ADD_P = PREFIX + "ADD_P" + POSTFIX;
 238     static {
 239         beforeMatchingNameRegex(ADD_P, "AddP");
 240     }
 241 
 242     public static final String ADD_VD = VECTOR_PREFIX + "ADD_VD" + POSTFIX;
 243     static {
 244         vectorNode(ADD_VD, "AddVD", TYPE_DOUBLE);
 245     }
 246 
 247     public static final String ADD_VI = VECTOR_PREFIX + "ADD_VI" + POSTFIX;
 248     static {
 249         vectorNode(ADD_VI, "AddVI", TYPE_INT);
 250     }
 251 
 252     public static final String ADD_VHF = VECTOR_PREFIX + "ADD_VHF" + POSTFIX;
 253     static {
 254         vectorNode(ADD_VHF, "AddVHF", TYPE_SHORT);
 255     }
 256 
 257     public static final String ADD_VF = VECTOR_PREFIX + "ADD_VF" + POSTFIX;
 258     static {
 259         vectorNode(ADD_VF, "AddVF", TYPE_FLOAT);
 260     }
 261 
 262     public static final String ADD_VB = VECTOR_PREFIX + "ADD_VB" + POSTFIX;
 263     static {
 264         vectorNode(ADD_VB, "AddVB", TYPE_BYTE);
 265     }
 266 
 267     public static final String ADD_VS = VECTOR_PREFIX + "ADD_VS" + POSTFIX;
 268     static {
 269         vectorNode(ADD_VS, "AddVS", TYPE_SHORT);
 270     }
 271 
 272     public static final String ADD_VL = VECTOR_PREFIX + "ADD_VL" + POSTFIX;
 273     static {
 274         vectorNode(ADD_VL, "AddVL", TYPE_LONG);
 275     }
 276 
 277     public static final String SATURATING_ADD_VB = VECTOR_PREFIX + "SATURATING_ADD_VB" + POSTFIX;
 278     static {
 279         vectorNode(SATURATING_ADD_VB, "SaturatingAddV", TYPE_BYTE);
 280     }
 281 
 282     public static final String SATURATING_ADD_VS = VECTOR_PREFIX + "SATURATING_ADD_VS" + POSTFIX;
 283     static {
 284         vectorNode(SATURATING_ADD_VS, "SaturatingAddV", TYPE_SHORT);
 285     }
 286 
 287     public static final String SATURATING_ADD_VI = VECTOR_PREFIX + "SATURATING_ADD_VI" + POSTFIX;
 288     static {
 289         vectorNode(SATURATING_ADD_VI, "SaturatingAddV", TYPE_INT);
 290     }
 291 
 292     public static final String SATURATING_ADD_VL = VECTOR_PREFIX + "SATURATING_ADD_VL" + POSTFIX;
 293     static {
 294         vectorNode(SATURATING_ADD_VL, "SaturatingAddV", TYPE_LONG);
 295     }
 296 
 297     public static final String SATURATING_SUB_VB = VECTOR_PREFIX + "SATURATING_SUB_VB" + POSTFIX;
 298     static {
 299         vectorNode(SATURATING_SUB_VB, "SaturatingSubV", TYPE_BYTE);
 300     }
 301 
 302     public static final String SATURATING_SUB_VS = VECTOR_PREFIX + "SATURATING_SUB_VS" + POSTFIX;
 303     static {
 304         vectorNode(SATURATING_SUB_VS, "SaturatingSubV", TYPE_SHORT);
 305     }
 306 
 307     public static final String SATURATING_SUB_VI = VECTOR_PREFIX + "SATURATING_SUB_VI" + POSTFIX;
 308     static {
 309         vectorNode(SATURATING_SUB_VI, "SaturatingSubV", TYPE_INT);
 310     }
 311 
 312     public static final String SATURATING_SUB_VL = VECTOR_PREFIX + "SATURATING_SUB_VL" + POSTFIX;
 313     static {
 314         vectorNode(SATURATING_SUB_VL, "SaturatingSubV", TYPE_LONG);
 315     }
 316 
 317     public static final String ADD_REDUCTION_V = PREFIX + "ADD_REDUCTION_V" + POSTFIX;
 318     static {
 319         beforeMatchingNameRegex(ADD_REDUCTION_V, "AddReductionV(B|S|I|L|F|D)");
 320     }
 321 
 322     public static final String ADD_REDUCTION_VD = PREFIX + "ADD_REDUCTION_VD" + POSTFIX;
 323     static {
 324         superWordNodes(ADD_REDUCTION_VD, "AddReductionVD");
 325     }
 326 
 327     public static final String ADD_REDUCTION_VF = PREFIX + "ADD_REDUCTION_VF" + POSTFIX;
 328     static {
 329         superWordNodes(ADD_REDUCTION_VF, "AddReductionVF");
 330     }
 331 
 332     public static final String ADD_REDUCTION_VI = PREFIX + "ADD_REDUCTION_VI" + POSTFIX;
 333     static {
 334         superWordNodes(ADD_REDUCTION_VI, "AddReductionVI");
 335     }
 336 
 337     public static final String ADD_REDUCTION_VL = PREFIX + "ADD_REDUCTION_VL" + POSTFIX;
 338     static {
 339         superWordNodes(ADD_REDUCTION_VL, "AddReductionVL");
 340     }
 341 
 342     public static final String OPAQUE_MULTIVERSIONING = PREFIX + "OPAQUE_MULTIVERSIONING" + POSTFIX;
 343     static {
 344         beforeMatchingNameRegex(OPAQUE_MULTIVERSIONING, "OpaqueMultiversioning");
 345     }
 346 
 347     public static final String REARRANGE_VB = VECTOR_PREFIX + "REARRANGE_VB" + POSTFIX;
 348     static {
 349         vectorNode(REARRANGE_VB, "VectorRearrange", TYPE_BYTE);
 350     }
 351 
 352     public static final String REARRANGE_VS = VECTOR_PREFIX + "REARRANGE_VS" + POSTFIX;
 353     static {
 354         vectorNode(REARRANGE_VS, "VectorRearrange", TYPE_SHORT);
 355     }
 356 
 357     public static final String REARRANGE_VI = VECTOR_PREFIX + "REARRANGE_VI" + POSTFIX;
 358     static {
 359         vectorNode(REARRANGE_VI, "VectorRearrange", TYPE_INT);
 360     }
 361 
 362     public static final String REARRANGE_VL = VECTOR_PREFIX + "REARRANGE_VL" + POSTFIX;
 363     static {
 364         vectorNode(REARRANGE_VL, "VectorRearrange", TYPE_LONG);
 365     }
 366 
 367     public static final String REARRANGE_VF = VECTOR_PREFIX + "REARRANGE_VF" + POSTFIX;
 368     static {
 369         vectorNode(REARRANGE_VF, "VectorRearrange", TYPE_FLOAT);
 370     }
 371 
 372     public static final String REARRANGE_VD = VECTOR_PREFIX + "REARRANGE_VD" + POSTFIX;
 373     static {
 374         vectorNode(REARRANGE_VD, "VectorRearrange", TYPE_DOUBLE);
 375     }
 376 
 377     public static final String ADD_P_OF = COMPOSITE_PREFIX + "ADD_P_OF" + POSTFIX;
 378     static {
 379         String regex = START + "addP_" + IS_REPLACED + MID + ".*" + END;
 380         machOnly(ADD_P_OF, regex);
 381     }
 382 
 383     public static final String ALLOC = PREFIX + "ALLOC" + POSTFIX;
 384     static {
 385         String regex = START + "Allocate\\b" + MID + END;
 386         macroNodes(ALLOC, regex);
 387     }
 388 
 389     public static final String ALLOC_OF = COMPOSITE_PREFIX + "ALLOC_OF" + POSTFIX;
 390     static {
 391         allocateOfNodes(ALLOC_OF, IS_REPLACED);
 392     }
 393 
 394     public static void allocateOfNodes(String irNodePlaceholder, String allocatee) {
 395         String regex = START + "Allocate\\b" + MID + "allocationKlass:.*\\b" + allocatee + "\\s.*" + END;
 396         macroNodes(irNodePlaceholder, regex);
 397     }
 398 
 399     public static final String ALLOC_ARRAY = PREFIX + "ALLOC_ARRAY" + POSTFIX;
 400     static {
 401         String regex = START + "AllocateArray\\b" + MID + END;
 402         macroNodes(ALLOC_ARRAY,  regex);
 403     }
 404 
 405     public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "ALLOC_ARRAY_OF" + POSTFIX;
 406     static {
 407         allocateArrayOfNodes(ALLOC_ARRAY_OF, IS_REPLACED);
 408     }
 409 
 410     public static void allocateArrayOfNodes(String irNodePlaceholder, String allocatee) {
 411         // Assuming we are looking for an array of "some/package/MyClass". The printout is
 412         // [Lsome/package/MyClass;
 413         // or, with more dimensions
 414         // [[[Lsome/package/MyClass;
 415 
 416         // Case where the searched string is a not fully qualified name (but maybe partially qualified):
 417         // package/MyClass or MyClass
 418         // The ".*\\b" will eat the "some/" and "some/package/" resp.
 419         String partial_name_prefix = ".+\\b";
 420 
 421         // The thing after "allocationKlass:" (the name of the allocated class) is a sequence of:
 422         // - a non-empty sequence of "["
 423         // - a single character ("L"),
 424         // - maybe a non-empty sequence of characters ending on a word boundary
 425         //   this sequence is omitted if the given name is already fully qualified (exact match)
 426         //   but will eat the package path prefix in the cases described above
 427         // - the name we are looking for
 428         // - the final ";".
 429         String name_part = "\\[+.(" + partial_name_prefix + ")?" + allocatee + ";";
 430         String regex = START + "AllocateArray\\b" + MID + "allocationKlass:" + name_part + ".*" + END;
 431         macroNodes(irNodePlaceholder, regex);
 432     }
 433 
 434     public static final String OR = PREFIX + "OR" + POSTFIX;
 435     static {
 436         beforeMatchingNameRegex(OR, "Or(I|L)");
 437     }
 438 
 439     public static final String AND = PREFIX + "AND" + POSTFIX;
 440     static {
 441         beforeMatchingNameRegex(AND, "And(I|L)");
 442     }
 443 
 444     public static final String AND_I = PREFIX + "AND_I" + POSTFIX;
 445     static {
 446         beforeMatchingNameRegex(AND_I, "AndI");
 447     }
 448 
 449     public static final String AND_L = PREFIX + "AND_L" + POSTFIX;
 450     static {
 451         beforeMatchingNameRegex(AND_L, "AndL");
 452     }
 453 
 454     public static final String AND_VB = VECTOR_PREFIX + "AND_VB" + POSTFIX;
 455     static {
 456         vectorNode(AND_VB, "AndV", TYPE_BYTE);
 457     }
 458 
 459     public static final String AND_VC = VECTOR_PREFIX + "AND_VC" + POSTFIX;
 460     static {
 461         vectorNode(AND_VC, "AndV", TYPE_CHAR);
 462     }
 463 
 464     public static final String AND_VS = VECTOR_PREFIX + "AND_VS" + POSTFIX;
 465     static {
 466         vectorNode(AND_VS, "AndV", TYPE_SHORT);
 467     }
 468 
 469     public static final String AND_VI = VECTOR_PREFIX + "AND_VI" + POSTFIX;
 470     static {
 471         vectorNode(AND_VI, "AndV", TYPE_INT);
 472     }
 473 
 474     public static final String AND_VL = VECTOR_PREFIX + "AND_VL" + POSTFIX;
 475     static {
 476         vectorNode(AND_VL, "AndV", TYPE_LONG);
 477     }
 478 
 479     public static final String AND_V_MASK = PREFIX + "AND_V_MASK" + POSTFIX;
 480     static {
 481         beforeMatchingNameRegex(AND_V_MASK, "AndVMask");
 482     }
 483 
 484     public static final String AND_REDUCTION_V = PREFIX + "AND_REDUCTION_V" + POSTFIX;
 485     static {
 486         superWordNodes(AND_REDUCTION_V, "AndReductionV");
 487     }
 488 
 489     public static final String CALL = PREFIX + "CALL" + POSTFIX;
 490     static {
 491         beforeMatchingNameRegex(CALL, "Call.*Java");
 492     }
 493 
 494     public static final String CALL_OF = COMPOSITE_PREFIX + "CALL_OF" + POSTFIX;
 495     static {
 496         callOfNodes(CALL_OF, "Call.*", IS_REPLACED + " " );
 497     }
 498 
 499     public static final String CALL_OF_METHOD = COMPOSITE_PREFIX + "CALL_OF_METHOD" + POSTFIX;
 500     static {
 501         callOfNodes(CALL_OF_METHOD, "Call.*Java", IS_REPLACED + " ");
 502     }
 503 
 504     public static final String STATIC_CALL = PREFIX + "STATIC_CALL" + POSTFIX;
 505     static {
 506         beforeMatchingNameRegex(STATIC_CALL, "CallStaticJava");
 507     }
 508 
 509     public static final String STATIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "STATIC_CALL_OF_METHOD" + POSTFIX;
 510     static {
 511         staticCallOfMethodNodes(STATIC_CALL_OF_METHOD, IS_REPLACED + " ");
 512     }
 513 
 514     public static void staticCallOfMethodNodes(String irNodePlaceholder, String calleeRegex) {
 515         callOfNodes(irNodePlaceholder, "CallStaticJava", calleeRegex);
 516     }
 517 
 518     public static final String CALL_LEAF_NO_FP = PREFIX + "CALL_LEAF_NO_FP" + POSTFIX;
 519     static {
 520         beforeMatchingNameRegex(CALL_LEAF_NO_FP, "CallLeafNoFP");
 521     }
 522 
 523     public static final String CALL_LEAF_NO_FP_OF_METHOD = COMPOSITE_PREFIX + "CALL_LEAF_NO_FP_OF_METHOD" + POSTFIX;
 524     static {
 525         callLeafNoFpOfMethodNodes(CALL_LEAF_NO_FP_OF_METHOD, IS_REPLACED);
 526     }
 527 
 528     public static void callLeafNoFpOfMethodNodes(String irNodePlaceholder, String calleeRegex) {
 529         callOfNodes(irNodePlaceholder, "CallLeafNoFP", calleeRegex);
 530     }
 531 
 532     public static final String CAST_II = PREFIX + "CAST_II" + POSTFIX;
 533     static {
 534         beforeMatchingNameRegex(CAST_II, "CastII");
 535     }
 536 
 537     public static final String CAST_LL = PREFIX + "CAST_LL" + POSTFIX;
 538     static {
 539         beforeMatchingNameRegex(CAST_LL, "CastLL");
 540     }
 541 
 542     public static final String CBNZW_HI = PREFIX + "CBNZW_HI" + POSTFIX;
 543     static {
 544         optoOnly(CBNZW_HI, "cbwhi");
 545     }
 546 
 547     public static final String CBZW_LS = PREFIX + "CBZW_LS" + POSTFIX;
 548     static {
 549         optoOnly(CBZW_LS, "cbwls");
 550     }
 551 
 552     public static final String CBZ_LS = PREFIX + "CBZ_LS" + POSTFIX;
 553     static {
 554         optoOnly(CBZ_LS, "cbls");
 555     }
 556 
 557     public static final String CBZ_HI = PREFIX + "CBZ_HI" + POSTFIX;
 558     static {
 559         optoOnly(CBZ_HI, "cbhi");
 560     }
 561 
 562     public static final String CHECKCAST_ARRAY = PREFIX + "CHECKCAST_ARRAY" + POSTFIX;
 563     static {
 564         String regex = "(((?i:cmp|CLFI|CLR).*aryklassptr:\\[.*:Constant|.*(?i:mov|mv|or).*aryklassptr:\\[.*:Constant.*\\R.*(cmp|CMP|CLR))" + END;
 565         optoOnly(CHECKCAST_ARRAY, regex);
 566     }
 567 
 568     public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "CHECKCAST_ARRAY_OF" + POSTFIX;
 569     static {
 570         String regex = "(((?i:cmp|CLFI|CLR).*aryklassptr:\\[.*" + IS_REPLACED + ":.*:Constant|.*(?i:mov|mv|or).*aryklassptr:\\[.*" + IS_REPLACED + ":.*:Constant.*\\R.*(cmp|CMP|CLR))" + END;
 571         optoOnly(CHECKCAST_ARRAY_OF, regex);
 572     }
 573 
 574     // Does not work on s390 (a rule containing this regex will be skipped on s390).
 575     public static final String CHECKCAST_ARRAYCOPY = PREFIX + "CHECKCAST_ARRAYCOPY" + POSTFIX;
 576     static {
 577         String regex = "(.*((?i:call_leaf_nofp,runtime)|CALL,\\s?runtime leaf nofp|BCTRL.*.leaf call).*checkcast_arraycopy.*" + END;
 578         optoOnly(CHECKCAST_ARRAYCOPY, regex);
 579     }
 580 
 581     public static final String CLASS_CHECK_TRAP = PREFIX + "CLASS_CHECK_TRAP" + POSTFIX;
 582     static {
 583         trapNodes(CLASS_CHECK_TRAP, "class_check");
 584     }
 585 
 586     public static final String CMOVE_F = PREFIX + "CMOVE_F" + POSTFIX;
 587     static {
 588         beforeMatchingNameRegex(CMOVE_F, "CMoveF");
 589     }
 590 
 591     public static final String CMOVE_D = PREFIX + "CMOVE_D" + POSTFIX;
 592     static {
 593         beforeMatchingNameRegex(CMOVE_D, "CMoveD");
 594     }
 595 
 596     public static final String CMOVE_I = PREFIX + "CMOVE_I" + POSTFIX;
 597     static {
 598         beforeMatchingNameRegex(CMOVE_I, "CMoveI");
 599     }
 600 
 601     public static final String CMOVE_L = PREFIX + "CMOVE_L" + POSTFIX;
 602     static {
 603         beforeMatchingNameRegex(CMOVE_L, "CMoveL");
 604     }
 605 
 606     public static final String CMP_F = PREFIX + "CMP_F" + POSTFIX;
 607     static {
 608         beforeMatchingNameRegex(CMP_F, "CmpF");
 609     }
 610 
 611     public static final String CMP_D = PREFIX + "CMP_D" + POSTFIX;
 612     static {
 613         beforeMatchingNameRegex(CMP_D, "CmpD");
 614     }
 615 
 616     public static final String CMP_I = PREFIX + "CMP_I" + POSTFIX;
 617     static {
 618         beforeMatchingNameRegex(CMP_I, "CmpI");
 619     }
 620 
 621     public static final String CMP_L = PREFIX + "CMP_L" + POSTFIX;
 622     static {
 623         beforeMatchingNameRegex(CMP_L, "CmpL");
 624     }
 625 
 626     public static final String CMP_U = PREFIX + "CMP_U" + POSTFIX;
 627     static {
 628         beforeMatchingNameRegex(CMP_U, "CmpU\\b");
 629     }
 630 
 631     public static final String CMP_U3 = PREFIX + "CMP_U3" + POSTFIX;
 632     static {
 633         beforeMatchingNameRegex(CMP_U3, "CmpU3");
 634     }
 635 
 636     public static final String CMP_UL = PREFIX + "CMP_UL" + POSTFIX;
 637     static {
 638         beforeMatchingNameRegex(CMP_UL, "CmpUL");
 639     }
 640 
 641     public static final String CMP_UL3 = PREFIX + "CMP_UL3" + POSTFIX;
 642     static {
 643         beforeMatchingNameRegex(CMP_UL3, "CmpUL3");
 644     }
 645 
 646     public static final String CMP_P = PREFIX + "CMP_P" + POSTFIX;
 647     static {
 648         beforeMatchingNameRegex(CMP_P, "CmpP");
 649     }
 650 
 651     public static final String CMP_N = PREFIX + "CMP_N" + POSTFIX;
 652     static {
 653         beforeMatchingNameRegex(CMP_N, "CmpN");
 654     }
 655 
 656     public static final String CMP_LT_MASK = PREFIX + "CMP_LT_MASK" + POSTFIX;
 657     static {
 658         beforeMatchingNameRegex(CMP_LT_MASK, "CmpLTMask");
 659     }
 660 
 661     public static final String ROUND_F = PREFIX + "ROUND_F" + POSTFIX;
 662     static {
 663         beforeMatchingNameRegex(ROUND_F, "RoundF");
 664     }
 665 
 666     public static final String ROUND_D = PREFIX + "ROUND_D" + POSTFIX;
 667     static {
 668         beforeMatchingNameRegex(ROUND_D, "RoundD");
 669     }
 670 
 671     public static final String COMPRESS_BITS = PREFIX + "COMPRESS_BITS" + POSTFIX;
 672     static {
 673         beforeMatchingNameRegex(COMPRESS_BITS, "CompressBits");
 674     }
 675 
 676     public static final String CONV = PREFIX + "CONV" + POSTFIX;
 677     static {
 678         beforeMatchingNameRegex(CONV, "Conv");
 679     }
 680 
 681     public static final String CONV_D2F = PREFIX + "CONV_D2F" + POSTFIX;
 682     static {
 683         beforeMatchingNameRegex(CONV_D2F, "ConvD2F");
 684     }
 685 
 686     public static final String CONV_D2I = PREFIX + "CONV_D2I" + POSTFIX;
 687     static {
 688         beforeMatchingNameRegex(CONV_D2I, "ConvD2I");
 689     }
 690 
 691     public static final String CONV_D2L = PREFIX + "CONV_D2L" + POSTFIX;
 692     static {
 693         beforeMatchingNameRegex(CONV_D2L, "ConvD2L");
 694     }
 695 
 696     public static final String CONV_F2D = PREFIX + "CONV_F2D" + POSTFIX;
 697     static {
 698         beforeMatchingNameRegex(CONV_F2D, "ConvF2D");
 699     }
 700 
 701     public static final String CONV_F2HF = PREFIX + "CONV_F2HF" + POSTFIX;
 702     static {
 703         beforeMatchingNameRegex(CONV_F2HF, "ConvF2HF");
 704     }
 705 
 706     public static final String CONV_F2I = PREFIX + "CONV_F2I" + POSTFIX;
 707     static {
 708         beforeMatchingNameRegex(CONV_F2I, "ConvF2I");
 709     }
 710 
 711     public static final String CONV_F2L = PREFIX + "CONV_F2L" + POSTFIX;
 712     static {
 713         beforeMatchingNameRegex(CONV_F2L, "ConvF2L");
 714     }
 715 
 716     public static final String CONV_I2L = PREFIX + "CONV_I2L" + POSTFIX;
 717     static {
 718         beforeMatchingNameRegex(CONV_I2L, "ConvI2L");
 719     }
 720 
 721     public static final String CONV_L2I = PREFIX + "CONV_L2I" + POSTFIX;
 722     static {
 723         beforeMatchingNameRegex(CONV_L2I, "ConvL2I");
 724     }
 725 
 726     public static final String CONV_HF2F = PREFIX + "CONV_HF2F" + POSTFIX;
 727     static {
 728         beforeMatchingNameRegex(CONV_HF2F, "ConvHF2F");
 729     }
 730 
 731     public static final String CON_I = PREFIX + "CON_I" + POSTFIX;
 732     static {
 733         beforeMatchingNameRegex(CON_I, "ConI");
 734     }
 735 
 736     public static final String CON_L = PREFIX + "CON_L" + POSTFIX;
 737     static {
 738         beforeMatchingNameRegex(CON_L, "ConL");
 739     }
 740 
 741     public static final String COUNTED_LOOP = PREFIX + "COUNTED_LOOP" + POSTFIX;
 742     static {
 743         String regex = START + "CountedLoop\\b" + MID + END;
 744         fromAfterCountedLoops(COUNTED_LOOP, regex);
 745     }
 746 
 747     public static final String COUNTED_LOOP_MAIN = PREFIX + "COUNTED_LOOP_MAIN" + POSTFIX;
 748     static {
 749         String regex = START + "CountedLoop\\b" + MID + "main" + END;
 750         fromAfterCountedLoops(COUNTED_LOOP_MAIN, regex);
 751     }
 752 
 753     public static final String DECODE_HEAP_OOP_NOT_NULL = PREFIX + "DECODE_HEAP_OOP_NOT_NULL" + POSTFIX;
 754     static {
 755         machOnly(DECODE_HEAP_OOP_NOT_NULL, "decodeHeapOop_not_null");
 756     }
 757 
 758     public static final String DIV = PREFIX + "DIV" + POSTFIX;
 759     static {
 760         beforeMatchingNameRegex(DIV, "Div(I|L|F|D)");
 761     }
 762 
 763     public static final String UDIV = PREFIX + "UDIV" + POSTFIX;
 764     static {
 765         beforeMatchingNameRegex(UDIV, "UDiv(I|L|F|D)");
 766     }
 767 
 768     public static final String DIV_BY_ZERO_TRAP = PREFIX + "DIV_BY_ZERO_TRAP" + POSTFIX;
 769     static {
 770         trapNodes(DIV_BY_ZERO_TRAP, "div0_check");
 771     }
 772 
 773     public static final String DIV_I = PREFIX + "DIV_I" + POSTFIX;
 774     static {
 775         beforeMatchingNameRegex(DIV_I, "DivI");
 776     }
 777 
 778     public static final String DIV_L = PREFIX + "DIV_L" + POSTFIX;
 779     static {
 780         beforeMatchingNameRegex(DIV_L, "DivL");
 781     }
 782 
 783     public static final String DIV_MOD_I = PREFIX + "DIV_MOD_I" + POSTFIX;
 784     static {
 785         beforeMatchingNameRegex(DIV_MOD_I, "DivModI");
 786     }
 787 
 788     public static final String DIV_MOD_L = PREFIX + "DIV_MOD_L" + POSTFIX;
 789     static {
 790         beforeMatchingNameRegex(DIV_MOD_L, "DivModL");
 791     }
 792 
 793     public static final String DIV_VHF = VECTOR_PREFIX + "DIV_VHF" + POSTFIX;
 794     static {
 795         vectorNode(DIV_VHF, "DivVHF", TYPE_SHORT);
 796     }
 797 
 798     public static final String DIV_VF = VECTOR_PREFIX + "DIV_VF" + POSTFIX;
 799     static {
 800         vectorNode(DIV_VF, "DivVF", TYPE_FLOAT);
 801     }
 802 
 803     public static final String DIV_VD = VECTOR_PREFIX + "DIV_VD" + POSTFIX;
 804     static {
 805         vectorNode(DIV_VD, "DivVD", TYPE_DOUBLE);
 806     }
 807 
 808     public static final String DYNAMIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "DYNAMIC_CALL_OF_METHOD" + POSTFIX;
 809     static {
 810         callOfNodes(DYNAMIC_CALL_OF_METHOD, "CallDynamicJava", IS_REPLACED);
 811     }
 812 
 813     public static final String EXPAND_BITS = PREFIX + "EXPAND_BITS" + POSTFIX;
 814     static {
 815         beforeMatchingNameRegex(EXPAND_BITS, "ExpandBits");
 816     }
 817 
 818     public static final String FAST_LOCK = PREFIX + "FAST_LOCK" + POSTFIX;
 819     static {
 820         beforeMatchingNameRegex(FAST_LOCK, "FastLock");
 821     }
 822 
 823     public static final String FAST_UNLOCK = PREFIX + "FAST_UNLOCK" + POSTFIX;
 824     static {
 825         String regex = START + "FastUnlock" + MID + END;
 826         fromMacroToBeforeMatching(FAST_UNLOCK, regex);
 827     }
 828 
 829     public static final String FIELD_ACCESS = PREFIX + "FIELD_ACCESS" + POSTFIX;
 830     static {
 831         String regex = "(.*Field: *" + END;
 832         optoOnly(FIELD_ACCESS, regex);
 833     }
 834 
 835     public static final String FMA_VHF = VECTOR_PREFIX + "FMA_VHF" + POSTFIX;
 836     static {
 837         vectorNode(FMA_VHF, "FmaVHF", TYPE_SHORT);
 838     }
 839 
 840     public static final String FMA_VF = VECTOR_PREFIX + "FMA_VF" + POSTFIX;
 841     static {
 842         vectorNode(FMA_VF, "FmaVF", TYPE_FLOAT);
 843     }
 844 
 845     public static final String FMA_VD = VECTOR_PREFIX + "FMA_VD" + POSTFIX;
 846     static {
 847         vectorNode(FMA_VD, "FmaVD", TYPE_DOUBLE);
 848     }
 849 
 850     public static final String FMA_HF = PREFIX + "FMA_HF" + POSTFIX;
 851     static {
 852         beforeMatchingNameRegex(FMA_HF, "FmaHF");
 853     }
 854 
 855     public static final String G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG" + POSTFIX;
 856     static {
 857         String regex = START + "g1CompareAndExchangeN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 858         machOnly(G1_COMPARE_AND_EXCHANGE_N_WITH_BARRIER_FLAG, regex);
 859     }
 860 
 861     public static final String G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG" + POSTFIX;
 862     static {
 863         String regex = START + "g1CompareAndExchangeP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 864         machOnly(G1_COMPARE_AND_EXCHANGE_P_WITH_BARRIER_FLAG, regex);
 865     }
 866 
 867     public static final String G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG" + POSTFIX;
 868     static {
 869         String regex = START + "g1CompareAndSwapN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 870         machOnly(G1_COMPARE_AND_SWAP_N_WITH_BARRIER_FLAG, regex);
 871     }
 872 
 873     public static final String G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG" + POSTFIX;
 874     static {
 875         String regex = START + "g1CompareAndSwapP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 876         machOnly(G1_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, regex);
 877     }
 878 
 879     public static final String G1_ENCODE_P_AND_STORE_N = PREFIX + "G1_ENCODE_P_AND_STORE_N" + POSTFIX;
 880     static {
 881         machOnlyNameRegex(G1_ENCODE_P_AND_STORE_N, "g1EncodePAndStoreN");
 882     }
 883 
 884     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;
 885     static {
 886         String regex = START + "g1EncodePAndStoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 887         machOnly(G1_ENCODE_P_AND_STORE_N_WITH_BARRIER_FLAG, regex);
 888     }
 889 
 890     public static final String G1_GET_AND_SET_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_N_WITH_BARRIER_FLAG" + POSTFIX;
 891     static {
 892         String regex = START + "g1GetAndSetN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 893         machOnly(G1_GET_AND_SET_N_WITH_BARRIER_FLAG, regex);
 894     }
 895 
 896     public static final String G1_GET_AND_SET_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_GET_AND_SET_P_WITH_BARRIER_FLAG" + POSTFIX;
 897     static {
 898         String regex = START + "g1GetAndSetP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 899         machOnly(G1_GET_AND_SET_P_WITH_BARRIER_FLAG, regex);
 900     }
 901 
 902     public static final String G1_LOAD_N = PREFIX + "G1_LOAD_N" + POSTFIX;
 903     static {
 904         machOnlyNameRegex(G1_LOAD_N, "g1LoadN");
 905     }
 906 
 907     public static final String G1_LOAD_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_N_WITH_BARRIER_FLAG" + POSTFIX;
 908     static {
 909         String regex = START + "g1LoadN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 910         machOnly(G1_LOAD_N_WITH_BARRIER_FLAG, regex);
 911     }
 912 
 913     public static final String G1_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX;
 914     static {
 915         String regex = START + "g1LoadP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 916         machOnly(G1_LOAD_P_WITH_BARRIER_FLAG, regex);
 917     }
 918 
 919     public static final String G1_STORE_N = PREFIX + "G1_STORE_N" + POSTFIX;
 920     static {
 921         machOnlyNameRegex(G1_STORE_N, "g1StoreN");
 922     }
 923 
 924     public static final String G1_STORE_N_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_N_WITH_BARRIER_FLAG" + POSTFIX;
 925     static {
 926         String regex = START + "g1StoreN\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 927         machOnly(G1_STORE_N_WITH_BARRIER_FLAG, regex);
 928     }
 929 
 930     public static final String G1_STORE_P = PREFIX + "G1_STORE_P" + POSTFIX;
 931     static {
 932         machOnlyNameRegex(G1_STORE_P, "g1StoreP");
 933     }
 934 
 935     public static final String G1_STORE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "G1_STORE_P_WITH_BARRIER_FLAG" + POSTFIX;
 936     static {
 937         String regex = START + "g1StoreP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
 938         machOnly(G1_STORE_P_WITH_BARRIER_FLAG, regex);
 939     }
 940 
 941     public static final String IF = PREFIX + "IF" + POSTFIX;
 942     static {
 943         beforeMatchingNameRegex(IF, "If\\b");
 944     }
 945 
 946     public static final String INLINE_TYPE = PREFIX + "INLINE_TYPE" + POSTFIX;
 947     static {
 948         beforeMatchingNameRegex(INLINE_TYPE, "InlineType");
 949     }
 950 
 951     // Does not work for VM builds without JVMCI like x86_32 (a rule containing this regex will be skipped without having JVMCI built).
 952     public static final String INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP = PREFIX + "INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP" + POSTFIX;
 953     static {
 954         trapNodes(INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP, "intrinsic_or_type_checked_inlining");
 955     }
 956 
 957     public static final String INTRINSIC_TRAP = PREFIX + "INTRINSIC_TRAP" + POSTFIX;
 958     static {
 959         trapNodes(INTRINSIC_TRAP, "intrinsic");
 960     }
 961 
 962     // Is only supported on riscv64.
 963     public static final String IS_FINITE_D = PREFIX + "IS_FINITE_D" + POSTFIX;
 964     static {
 965         beforeMatchingNameRegex(IS_FINITE_D, "IsFiniteD");
 966     }
 967 
 968     // Is only supported on riscv64.
 969     public static final String IS_FINITE_F = PREFIX + "IS_FINITE_F" + POSTFIX;
 970     static {
 971         beforeMatchingNameRegex(IS_FINITE_F, "IsFiniteF");
 972     }
 973 
 974     public static final String IS_INFINITE_D = PREFIX + "IS_INFINITE_D" + POSTFIX;
 975     static {
 976         beforeMatchingNameRegex(IS_INFINITE_D, "IsInfiniteD");
 977     }
 978 
 979     public static final String IS_INFINITE_F = PREFIX + "IS_INFINITE_F" + POSTFIX;
 980     static {
 981         beforeMatchingNameRegex(IS_INFINITE_F, "IsInfiniteF");
 982     }
 983 
 984     // Only supported on x86.
 985     public static final String LEA_P = PREFIX + "LEA_P" + POSTFIX;
 986     static {
 987         machOnly(LEA_P, "leaP(CompressedOopOffset|(8|32)Narrow)");
 988     }
 989 
 990     public static final String LOAD = PREFIX + "LOAD" + POSTFIX;
 991     static {
 992         beforeMatchingNameRegex(LOAD, "Load(B|UB|S|US|I|L|F|D|P|N)");
 993     }
 994 
 995     public static final String LOAD_OF_CLASS = COMPOSITE_PREFIX + "LOAD_OF_CLASS" + POSTFIX;
 996     static {
 997         anyLoadOfNodes(LOAD_OF_CLASS, IS_REPLACED);
 998     }
 999 
1000     public static void anyLoadOfNodes(String irNodePlaceholder, String fieldHolder) {
1001         loadOfNodes(irNodePlaceholder, "Load(B|UB|S|US|I|L|F|D|P|N)", fieldHolder);
1002     }
1003 
1004     public static final String LOAD_B = PREFIX + "LOAD_B" + POSTFIX;
1005     static {
1006         beforeMatchingNameRegex(LOAD_B, "LoadB");
1007     }
1008 
1009     public static final String LOAD_B_OF_CLASS = COMPOSITE_PREFIX + "LOAD_B_OF_CLASS" + POSTFIX;
1010     static {
1011         loadOfNodes(LOAD_B_OF_CLASS, "LoadB", IS_REPLACED);
1012     }
1013 
1014     public static final String LOAD_D = PREFIX + "LOAD_D" + POSTFIX;
1015     static {
1016         beforeMatchingNameRegex(LOAD_D, "LoadD");
1017     }
1018 
1019     public static final String LOAD_D_OF_CLASS = COMPOSITE_PREFIX + "LOAD_D_OF_CLASS" + POSTFIX;
1020     static {
1021         loadOfNodes(LOAD_D_OF_CLASS, "LoadD", IS_REPLACED);
1022     }
1023 
1024     public static final String LOAD_F = PREFIX + "LOAD_F" + POSTFIX;
1025     static {
1026         beforeMatchingNameRegex(LOAD_F, "LoadF");
1027     }
1028 
1029     public static final String LOAD_F_OF_CLASS = COMPOSITE_PREFIX + "LOAD_F_OF_CLASS" + POSTFIX;
1030     static {
1031         loadOfNodes(LOAD_F_OF_CLASS, "LoadF", IS_REPLACED);
1032     }
1033 
1034     public static final String LOAD_I = PREFIX + "LOAD_I" + POSTFIX;
1035     static {
1036         beforeMatchingNameRegex(LOAD_I, "LoadI");
1037     }
1038 
1039     public static final String LOAD_I_OF_CLASS = COMPOSITE_PREFIX + "LOAD_I_OF_CLASS" + POSTFIX;
1040     static {
1041         loadOfNodes(LOAD_I_OF_CLASS, "LoadI", IS_REPLACED);
1042     }
1043 
1044     public static final String LOAD_KLASS = PREFIX + "LOAD_KLASS" + POSTFIX;
1045     static {
1046         beforeMatchingNameRegex(LOAD_KLASS, "LoadKlass");
1047     }
1048 
1049     public static final String LOAD_NKLASS = PREFIX + "LOAD_NKLASS" + POSTFIX;
1050     static {
1051         beforeMatchingNameRegex(LOAD_NKLASS, "LoadNKlass");
1052     }
1053 
1054     public static final String LOAD_KLASS_OR_NKLASS = PREFIX + "LOAD_KLASS_OR_NKLASS" + POSTFIX;
1055     static {
1056         beforeMatchingNameRegex(LOAD_KLASS_OR_NKLASS, "LoadN?Klass");
1057     }
1058 
1059     public static final String LOAD_L = PREFIX + "LOAD_L" + POSTFIX;
1060     static {
1061         beforeMatchingNameRegex(LOAD_L, "LoadL");
1062     }
1063 
1064     public static final String LOAD_L_OF_CLASS = COMPOSITE_PREFIX + "LOAD_L_OF_CLASS" + POSTFIX;
1065     static {
1066         loadOfNodes(LOAD_L_OF_CLASS, "LoadL", IS_REPLACED);
1067     }
1068 
1069     public static final String LOAD_N = PREFIX + "LOAD_N" + POSTFIX;
1070     static {
1071         beforeMatchingNameRegex(LOAD_N, "LoadN");
1072     }
1073 
1074     public static final String LOAD_N_OF_CLASS = COMPOSITE_PREFIX + "LOAD_N_OF_CLASS" + POSTFIX;
1075     static {
1076         loadOfNodes(LOAD_N_OF_CLASS, "LoadN", IS_REPLACED);
1077     }
1078 
1079     public static final String LOAD_OF_FIELD = COMPOSITE_PREFIX + "LOAD_OF_FIELD" + POSTFIX;
1080     static {
1081         String regex = START + "Load(B|C|S|I|L|F|D|P|N)" + MID + "@.*name=" + IS_REPLACED + ",.*" + END;
1082         beforeMatching(LOAD_OF_FIELD, regex);
1083     }
1084 
1085     public static final String LOAD_P = PREFIX + "LOAD_P" + POSTFIX;
1086     static {
1087         beforeMatchingNameRegex(LOAD_P, "LoadP");
1088     }
1089 
1090     public static final String LOAD_P_OF_CLASS = COMPOSITE_PREFIX + "LOAD_P_OF_CLASS" + POSTFIX;
1091     static {
1092         loadOfNodes(LOAD_P_OF_CLASS, "LoadP", IS_REPLACED);
1093     }
1094 
1095     public static final String LOAD_S = PREFIX + "LOAD_S" + POSTFIX;
1096     static {
1097         beforeMatchingNameRegex(LOAD_S, "LoadS");
1098     }
1099 
1100     public static final String LOAD_S_OF_CLASS = COMPOSITE_PREFIX + "LOAD_S_OF_CLASS" + POSTFIX;
1101     static {
1102         loadOfNodes(LOAD_S_OF_CLASS, "LoadS", IS_REPLACED);
1103     }
1104 
1105     public static final String LOAD_UB = PREFIX + "LOAD_UB" + POSTFIX;
1106     static {
1107         beforeMatchingNameRegex(LOAD_UB, "LoadUB");
1108     }
1109 
1110     public static final String LOAD_UB_OF_CLASS = COMPOSITE_PREFIX + "LOAD_UB_OF_CLASS" + POSTFIX;
1111     static {
1112         loadOfNodes(LOAD_UB_OF_CLASS, "LoadUB", IS_REPLACED);
1113     }
1114 
1115     public static final String LOAD_US = PREFIX + "LOAD_US" + POSTFIX;
1116     static {
1117         beforeMatchingNameRegex(LOAD_US, "LoadUS");
1118     }
1119 
1120     public static final String LOAD_US_OF_CLASS = COMPOSITE_PREFIX + "LOAD_US_OF_CLASS" + POSTFIX;
1121     static {
1122         loadOfNodes(LOAD_US_OF_CLASS, "LoadUS", IS_REPLACED);
1123     }
1124 
1125     public static final String LOAD_VECTOR_B = VECTOR_PREFIX + "LOAD_VECTOR_B" + POSTFIX;
1126     static {
1127         vectorNode(LOAD_VECTOR_B, "LoadVector", TYPE_BYTE);
1128     }
1129 
1130     public static final String LOAD_VECTOR_C = VECTOR_PREFIX + "LOAD_VECTOR_C" + POSTFIX;
1131     static {
1132         vectorNode(LOAD_VECTOR_C, "LoadVector", TYPE_CHAR);
1133     }
1134 
1135     public static final String LOAD_VECTOR_S = VECTOR_PREFIX + "LOAD_VECTOR_S" + POSTFIX;
1136     static {
1137         vectorNode(LOAD_VECTOR_S, "LoadVector", TYPE_SHORT);
1138     }
1139 
1140     public static final String LOAD_VECTOR_I = VECTOR_PREFIX + "LOAD_VECTOR_I" + POSTFIX;
1141     static {
1142         vectorNode(LOAD_VECTOR_I, "LoadVector", TYPE_INT);
1143     }
1144 
1145     public static final String LOAD_VECTOR_L = VECTOR_PREFIX + "LOAD_VECTOR_L" + POSTFIX;
1146     static {
1147         vectorNode(LOAD_VECTOR_L, "LoadVector", TYPE_LONG);
1148     }
1149 
1150     public static final String LOAD_VECTOR_F = VECTOR_PREFIX + "LOAD_VECTOR_F" + POSTFIX;
1151     static {
1152         vectorNode(LOAD_VECTOR_F, "LoadVector", TYPE_FLOAT);
1153     }
1154 
1155     public static final String LOAD_VECTOR_D = VECTOR_PREFIX + "LOAD_VECTOR_D" + POSTFIX;
1156     static {
1157         vectorNode(LOAD_VECTOR_D, "LoadVector", TYPE_DOUBLE);
1158     }
1159 
1160     public static final String LOAD_VECTOR_GATHER = PREFIX + "LOAD_VECTOR_GATHER" + POSTFIX;
1161     static {
1162         beforeMatchingNameRegex(LOAD_VECTOR_GATHER, "LoadVectorGather");
1163     }
1164 
1165     public static final String LOAD_VECTOR_MASKED = PREFIX + "LOAD_VECTOR_MASKED" + POSTFIX;
1166     static {
1167         beforeMatchingNameRegex(LOAD_VECTOR_MASKED, "LoadVectorMasked");
1168     }
1169 
1170     public static final String LOAD_VECTOR_GATHER_MASKED = PREFIX + "LOAD_VECTOR_GATHER_MASKED" + POSTFIX;
1171     static {
1172         beforeMatchingNameRegex(LOAD_VECTOR_GATHER_MASKED, "LoadVectorGatherMasked");
1173     }
1174 
1175     public static final String LONG_COUNTED_LOOP = PREFIX + "LONG_COUNTED_LOOP" + POSTFIX;
1176     static {
1177         String regex = START + "LongCountedLoop\\b" + MID + END;
1178         fromAfterCountedLoops(LONG_COUNTED_LOOP, regex);
1179     }
1180 
1181     public static final String LOOP = PREFIX + "LOOP" + POSTFIX;
1182     static {
1183         String regex = START + "Loop" + MID + END;
1184         fromBeforeCountedLoops(LOOP, regex);
1185     }
1186 
1187     public static final String LSHIFT = PREFIX + "LSHIFT" + POSTFIX;
1188     static {
1189         beforeMatchingNameRegex(LSHIFT, "LShift(I|L)");
1190     }
1191 
1192     public static final String LSHIFT_I = PREFIX + "LSHIFT_I" + POSTFIX;
1193     static {
1194         beforeMatchingNameRegex(LSHIFT_I, "LShiftI");
1195     }
1196 
1197     public static final String LSHIFT_L = PREFIX + "LSHIFT_L" + POSTFIX;
1198     static {
1199         beforeMatchingNameRegex(LSHIFT_L, "LShiftL");
1200     }
1201 
1202     public static final String LSHIFT_VB = VECTOR_PREFIX + "LSHIFT_VB" + POSTFIX;
1203     static {
1204         vectorNode(LSHIFT_VB, "LShiftVB", TYPE_BYTE);
1205     }
1206 
1207     public static final String LSHIFT_VS = VECTOR_PREFIX + "LSHIFT_VS" + POSTFIX;
1208     static {
1209         vectorNode(LSHIFT_VS, "LShiftVS", TYPE_SHORT);
1210     }
1211 
1212     public static final String LSHIFT_VC = VECTOR_PREFIX + "LSHIFT_VC" + POSTFIX;
1213     static {
1214         vectorNode(LSHIFT_VC, "LShiftVS", TYPE_CHAR); // using short op with char type
1215     }
1216 
1217     public static final String LSHIFT_VI = VECTOR_PREFIX + "LSHIFT_VI" + POSTFIX;
1218     static {
1219         vectorNode(LSHIFT_VI, "LShiftVI", TYPE_INT);
1220     }
1221 
1222     public static final String LSHIFT_VL = VECTOR_PREFIX + "LSHIFT_VL" + POSTFIX;
1223     static {
1224         vectorNode(LSHIFT_VL, "LShiftVL", TYPE_LONG);
1225     }
1226 
1227     public static final String MACH_TEMP = PREFIX + "MACH_TEMP" + POSTFIX;
1228     static {
1229         machOnlyNameRegex(MACH_TEMP, "MachTemp");
1230     }
1231 
1232     public static final String MACRO_LOGIC_V = PREFIX + "MACRO_LOGIC_V" + POSTFIX;
1233     static {
1234         afterBarrierExpansionToBeforeMatching(MACRO_LOGIC_V, "MacroLogicV");
1235     }
1236 
1237     public static final String MAX = PREFIX + "MAX" + POSTFIX;
1238     static {
1239         beforeMatchingNameRegex(MAX, "Max(I|L|F|D)");
1240     }
1241 
1242     public static final String MAX_D = PREFIX + "MAX_D" + POSTFIX;
1243     static {
1244         beforeMatchingNameRegex(MAX_D, "MaxD");
1245     }
1246 
1247     public static final String MAX_D_REDUCTION_REG = PREFIX + "MAX_D_REDUCTION_REG" + POSTFIX;
1248     static {
1249         machOnlyNameRegex(MAX_D_REDUCTION_REG, "maxD_reduction_reg");
1250     }
1251 
1252     public static final String MAX_D_REG = PREFIX + "MAX_D_REG" + POSTFIX;
1253     static {
1254         machOnlyNameRegex(MAX_D_REG, "maxD_reg");
1255     }
1256 
1257     public static final String MAX_F = PREFIX + "MAX_F" + POSTFIX;
1258     static {
1259         beforeMatchingNameRegex(MAX_F, "MaxF");
1260     }
1261 
1262     public static final String MAX_F_REDUCTION_REG = PREFIX + "MAX_F_REDUCTION_REG" + POSTFIX;
1263     static {
1264         machOnlyNameRegex(MAX_F_REDUCTION_REG, "maxF_reduction_reg");
1265     }
1266 
1267     public static final String MAX_F_REG = PREFIX + "MAX_F_REG" + POSTFIX;
1268     static {
1269         machOnlyNameRegex(MAX_F_REG, "maxF_reg");
1270     }
1271 
1272     public static final String MAX_I = PREFIX + "MAX_I" + POSTFIX;
1273     static {
1274         beforeMatchingNameRegex(MAX_I, "MaxI");
1275     }
1276 
1277     public static final String MAX_L = PREFIX + "MAX_L" + POSTFIX;
1278     static {
1279         beforeMatchingNameRegex(MAX_L, "MaxL");
1280     }
1281 
1282     public static final String MAX_VI = VECTOR_PREFIX + "MAX_VI" + POSTFIX;
1283     static {
1284         vectorNode(MAX_VI, "MaxV", TYPE_INT);
1285     }
1286 
1287     public static final String MAX_VHF = VECTOR_PREFIX + "MAX_VHF" + POSTFIX;
1288     static {
1289         vectorNode(MAX_VHF, "MaxVHF", TYPE_SHORT);
1290     }
1291 
1292     public static final String MAX_VF = VECTOR_PREFIX + "MAX_VF" + POSTFIX;
1293     static {
1294         vectorNode(MAX_VF, "MaxV", TYPE_FLOAT);
1295     }
1296 
1297     public static final String MAX_VD = VECTOR_PREFIX + "MAX_VD" + POSTFIX;
1298     static {
1299         vectorNode(MAX_VD, "MaxV", TYPE_DOUBLE);
1300     }
1301 
1302     public static final String MAX_VL = VECTOR_PREFIX + "MAX_VL" + POSTFIX;
1303     static {
1304         vectorNode(MAX_VL, "MaxV", TYPE_LONG);
1305     }
1306 
1307     public static final String MEMBAR = PREFIX + "MEMBAR" + POSTFIX;
1308     static {
1309         beforeMatchingNameRegex(MEMBAR, "MemBar");
1310     }
1311 
1312     public static final String MEMBAR_ACQUIRE = PREFIX + "MEMBAR_ACQUIRE" + POSTFIX;
1313     static {
1314         beforeMatchingNameRegex(MEMBAR_ACQUIRE, "MemBarAcquire");
1315     }
1316 
1317     public static final String MEMBAR_RELEASE = PREFIX + "MEMBAR_RELEASE" + POSTFIX;
1318     static {
1319         beforeMatchingNameRegex(MEMBAR_RELEASE, "MemBarRelease");
1320     }
1321 
1322     public static final String MEMBAR_STORESTORE = PREFIX + "MEMBAR_STORESTORE" + POSTFIX;
1323     static {
1324         beforeMatchingNameRegex(MEMBAR_STORESTORE, "MemBarStoreStore");
1325     }
1326 
1327     public static final String MEMBAR_VOLATILE = PREFIX + "MEMBAR_VOLATILE" + POSTFIX;
1328     static {
1329         beforeMatchingNameRegex(MEMBAR_VOLATILE, "MemBarVolatile");
1330     }
1331 
1332     public static final String MEM_TO_REG_SPILL_COPY = PREFIX + "MEM_TO_REG_SPILL_COPY" + POSTFIX;
1333     static {
1334         machOnly(MEM_TO_REG_SPILL_COPY, "MemToRegSpillCopy");
1335     }
1336 
1337     public static final String MEM_TO_REG_SPILL_COPY_TYPE = COMPOSITE_PREFIX + "MEM_TO_REG_SPILL_COPY_TYPE" + POSTFIX;
1338     static {
1339         String regex = START + "MemToRegSpillCopy" + MID + IS_REPLACED + ".*" + END;
1340         machOnly(MEM_TO_REG_SPILL_COPY_TYPE, regex);
1341     }
1342 
1343     public static final String MIN = PREFIX + "MIN" + POSTFIX;
1344     static {
1345         beforeMatchingNameRegex(MIN, "Min(I|L)");
1346     }
1347 
1348     public static final String MIN_D = PREFIX + "MIN_D" + POSTFIX;
1349     static {
1350         beforeMatchingNameRegex(MIN_D, "MinD");
1351     }
1352 
1353     public static final String MIN_D_REDUCTION_REG = PREFIX + "MIN_D_REDUCTION_REG" + POSTFIX;
1354     static {
1355         machOnlyNameRegex(MIN_D_REDUCTION_REG, "minD_reduction_reg");
1356     }
1357 
1358     public static final String MIN_D_REG = PREFIX + "MIN_D_REG" + POSTFIX;
1359     static {
1360         machOnlyNameRegex(MIN_D_REG, "minD_reg");
1361     }
1362 
1363     public static final String MIN_F = PREFIX + "MIN_F" + POSTFIX;
1364     static {
1365         beforeMatchingNameRegex(MIN_F, "MinF");
1366     }
1367 
1368     public static final String MIN_F_REDUCTION_REG = PREFIX + "MIN_F_REDUCTION_REG" + POSTFIX;
1369     static {
1370         machOnlyNameRegex(MIN_F_REDUCTION_REG, "minF_reduction_reg");
1371     }
1372 
1373     public static final String MIN_F_REG = PREFIX + "MIN_F_REG" + POSTFIX;
1374     static {
1375         machOnlyNameRegex(MIN_F_REG, "minF_reg");
1376     }
1377 
1378     public static final String MIN_I = PREFIX + "MIN_I" + POSTFIX;
1379     static {
1380         beforeMatchingNameRegex(MIN_I, "MinI");
1381     }
1382 
1383     public static final String MIN_L = PREFIX + "MIN_L" + POSTFIX;
1384     static {
1385         beforeMatchingNameRegex(MIN_L, "MinL");
1386     }
1387 
1388     public static final String MIN_HF = PREFIX + "MIN_HF" + POSTFIX;
1389     static {
1390         beforeMatchingNameRegex(MIN_HF, "MinHF");
1391     }
1392 
1393     public static final String MAX_HF = PREFIX + "MAX_HF" + POSTFIX;
1394     static {
1395         beforeMatchingNameRegex(MAX_HF, "MaxHF");
1396     }
1397 
1398     public static final String MIN_VI = VECTOR_PREFIX + "MIN_VI" + POSTFIX;
1399     static {
1400         vectorNode(MIN_VI, "MinV", TYPE_INT);
1401     }
1402 
1403     public static final String MIN_VHF = VECTOR_PREFIX + "MIN_VHF" + POSTFIX;
1404     static {
1405         vectorNode(MIN_VHF, "MinVHF", TYPE_SHORT);
1406     }
1407 
1408     public static final String MIN_VF = VECTOR_PREFIX + "MIN_VF" + POSTFIX;
1409     static {
1410         vectorNode(MIN_VF, "MinV", TYPE_FLOAT);
1411     }
1412 
1413     public static final String MIN_VD = VECTOR_PREFIX + "MIN_VD" + POSTFIX;
1414     static {
1415         vectorNode(MIN_VD, "MinV", TYPE_DOUBLE);
1416     }
1417 
1418     public static final String MIN_VL = VECTOR_PREFIX + "MIN_VL" + POSTFIX;
1419     static {
1420         vectorNode(MIN_VL, "MinV", TYPE_LONG);
1421     }
1422 
1423     public static final String MOD_I = PREFIX + "MOD_I" + POSTFIX;
1424     static {
1425         beforeMatchingNameRegex(MOD_I, "ModI");
1426     }
1427 
1428     public static final String MOD_L = PREFIX + "MOD_L" + POSTFIX;
1429     static {
1430         beforeMatchingNameRegex(MOD_L, "ModL");
1431     }
1432 
1433     public static final String MOV_F2I = PREFIX + "MOV_F2I" + POSTFIX;
1434     static {
1435         beforeMatchingNameRegex(MOV_F2I, "MoveF2I");
1436     }
1437 
1438     public static final String MOV_I2F = PREFIX + "MOV_I2F" + POSTFIX;
1439     static {
1440         beforeMatchingNameRegex(MOV_I2F, "MoveI2F");
1441     }
1442 
1443     public static final String MOV_D2L = PREFIX + "MOV_D2L" + POSTFIX;
1444     static {
1445         beforeMatchingNameRegex(MOV_D2L, "MoveD2L");
1446     }
1447 
1448     public static final String MOV_L2D = PREFIX + "MOD_L2D" + POSTFIX;
1449     static {
1450         beforeMatchingNameRegex(MOV_L2D, "MoveL2D");
1451     }
1452 
1453     public static final String MUL = PREFIX + "MUL" + POSTFIX;
1454     static {
1455         beforeMatchingNameRegex(MUL, "Mul(I|L|F|D)");
1456     }
1457 
1458     public static final String MUL_ADD_S2I = PREFIX + "MUL_ADD_S2I" + POSTFIX;
1459     static {
1460         beforeMatchingNameRegex(MUL_ADD_S2I, "MulAddS2I");
1461     }
1462 
1463     public static final String MUL_ADD_VS2VI = VECTOR_PREFIX + "MUL_ADD_VS2VI" + POSTFIX;
1464     static {
1465         vectorNode(MUL_ADD_VS2VI, "MulAddVS2VI", TYPE_INT);
1466     }
1467 
1468     public static final String UMIN_VB = VECTOR_PREFIX + "UMIN_VB" + POSTFIX;
1469     static {
1470         vectorNode(UMIN_VB, "UMinV", TYPE_BYTE);
1471     }
1472 
1473     public static final String UMIN_VS = VECTOR_PREFIX + "UMIN_VS" + POSTFIX;
1474     static {
1475         vectorNode(UMIN_VS, "UMinV", TYPE_SHORT);
1476     }
1477 
1478     public static final String UMIN_VI = VECTOR_PREFIX + "UMIN_VI" + POSTFIX;
1479     static {
1480         vectorNode(UMIN_VI, "UMinV", TYPE_INT);
1481     }
1482 
1483     public static final String UMIN_VL = VECTOR_PREFIX + "UMIN_VL" + POSTFIX;
1484     static {
1485         vectorNode(UMIN_VL, "UMinV", TYPE_LONG);
1486     }
1487 
1488     public static final String UMAX_VB = VECTOR_PREFIX + "UMAX_VB" + POSTFIX;
1489     static {
1490         vectorNode(UMAX_VB, "UMaxV", TYPE_BYTE);
1491     }
1492 
1493     public static final String UMAX_VS = VECTOR_PREFIX + "UMAX_VS" + POSTFIX;
1494     static {
1495         vectorNode(UMAX_VS, "UMaxV", TYPE_SHORT);
1496     }
1497 
1498     public static final String UMAX_VI = VECTOR_PREFIX + "UMAX_VI" + POSTFIX;
1499     static {
1500         vectorNode(UMAX_VI, "UMaxV", TYPE_INT);
1501     }
1502 
1503     public static final String UMAX_VL = VECTOR_PREFIX + "UMAX_VL" + POSTFIX;
1504     static {
1505         vectorNode(UMAX_VL, "UMaxV", TYPE_LONG);
1506     }
1507 
1508     public static final String MASK_ALL = PREFIX + "MASK_ALL" + POSTFIX;
1509     static {
1510         beforeMatchingNameRegex(MASK_ALL, "MaskAll");
1511     }
1512 
1513     public static final String VECTOR_LONG_TO_MASK = PREFIX + "VECTOR_LONG_TO_MASK" + POSTFIX;
1514     static {
1515         beforeMatchingNameRegex(VECTOR_LONG_TO_MASK, "VectorLongToMask");
1516     }
1517 
1518     public static final String VECTOR_MASK_TO_LONG = PREFIX + "VECTOR_MASK_TO_LONG" + POSTFIX;
1519     static {
1520         beforeMatchingNameRegex(VECTOR_MASK_TO_LONG, "VectorMaskToLong");
1521     }
1522 
1523     public static final String VECTOR_MASK_LANE_IS_SET = PREFIX + "VECTOR_MASK_LANE_IS_SET" + POSTFIX;
1524     static {
1525         beforeMatchingNameRegex(VECTOR_MASK_LANE_IS_SET, "ExtractUB");
1526     }
1527 
1528     public static final String VECTOR_MASK_GEN = PREFIX + "VECTOR_MASK_GEN" + POSTFIX;
1529     static {
1530         beforeMatchingNameRegex(VECTOR_MASK_GEN, "VectorMaskGen");
1531     }
1532 
1533     public static final String VECTOR_MASK_FIRST_TRUE = PREFIX + "VECTOR_MASK_FIRST_TRUE" + POSTFIX;
1534     static {
1535         beforeMatchingNameRegex(VECTOR_MASK_FIRST_TRUE, "VectorMaskFirstTrue");
1536     }
1537 
1538     // Can only be used if libjsvml or libsleef is available
1539     public static final String CALL_LEAF_VECTOR = PREFIX + "CALL_LEAF_VECTOR" + POSTFIX;
1540     static {
1541         beforeMatchingNameRegex(CALL_LEAF_VECTOR, "CallLeafVector");
1542     }
1543 
1544     // Can only be used if avx512_vnni is available.
1545     public static final String MUL_ADD_VS2VI_VNNI = PREFIX + "MUL_ADD_VS2VI_VNNI" + POSTFIX;
1546     static {
1547         machOnly(MUL_ADD_VS2VI_VNNI, "vmuladdaddS2I_reg");
1548     }
1549 
1550     public static final String MUL_D = PREFIX + "MUL_D" + POSTFIX;
1551     static {
1552         beforeMatchingNameRegex(MUL_D, "MulD");
1553     }
1554 
1555     public static final String MUL_F = PREFIX + "MUL_F" + POSTFIX;
1556     static {
1557         beforeMatchingNameRegex(MUL_F, "MulF");
1558     }
1559 
1560     public static final String MUL_HF = PREFIX + "MUL_HF" + POSTFIX;
1561     static {
1562         beforeMatchingNameRegex(MUL_HF, "MulHF");
1563     }
1564 
1565     public static final String MUL_I = PREFIX + "MUL_I" + POSTFIX;
1566     static {
1567         beforeMatchingNameRegex(MUL_I, "MulI");
1568     }
1569 
1570     public static final String MUL_L = PREFIX + "MUL_L" + POSTFIX;
1571     static {
1572         beforeMatchingNameRegex(MUL_L, "MulL");
1573     }
1574 
1575     public static final String MUL_VL = VECTOR_PREFIX + "MUL_VL" + POSTFIX;
1576     static {
1577         vectorNode(MUL_VL, "MulVL", TYPE_LONG);
1578     }
1579 
1580     public static final String MUL_VI = VECTOR_PREFIX + "MUL_VI" + POSTFIX;
1581     static {
1582         vectorNode(MUL_VI, "MulVI", TYPE_INT);
1583     }
1584 
1585     public static final String MUL_VHF = VECTOR_PREFIX + "MUL_VHF" + POSTFIX;
1586     static {
1587         vectorNode(MUL_VHF, "MulVHF", TYPE_SHORT);
1588     }
1589 
1590     public static final String MUL_VF = VECTOR_PREFIX + "MUL_VF" + POSTFIX;
1591     static {
1592         vectorNode(MUL_VF, "MulVF", TYPE_FLOAT);
1593     }
1594 
1595     public static final String MUL_VD = VECTOR_PREFIX + "MUL_VD" + POSTFIX;
1596     static {
1597         vectorNode(MUL_VD, "MulVD", TYPE_DOUBLE);
1598     }
1599 
1600     public static final String MUL_VB = VECTOR_PREFIX + "MUL_VB" + POSTFIX;
1601     static {
1602         vectorNode(MUL_VB, "MulVB", TYPE_BYTE);
1603     }
1604 
1605     public static final String MUL_VS = VECTOR_PREFIX + "MUL_VS" + POSTFIX;
1606     static {
1607         vectorNode(MUL_VS, "MulVS", TYPE_SHORT);
1608     }
1609 
1610     public static final String MUL_REDUCTION_VD = PREFIX + "MUL_REDUCTION_VD" + POSTFIX;
1611     static {
1612         superWordNodes(MUL_REDUCTION_VD, "MulReductionVD");
1613     }
1614 
1615     public static final String MUL_REDUCTION_VF = PREFIX + "MUL_REDUCTION_VF" + POSTFIX;
1616     static {
1617         superWordNodes(MUL_REDUCTION_VF, "MulReductionVF");
1618     }
1619 
1620     public static final String MUL_REDUCTION_VI = PREFIX + "MUL_REDUCTION_VI" + POSTFIX;
1621     static {
1622         superWordNodes(MUL_REDUCTION_VI, "MulReductionVI");
1623     }
1624 
1625     public static final String MUL_REDUCTION_VL = PREFIX + "MUL_REDUCTION_VL" + POSTFIX;
1626     static {
1627         superWordNodes(MUL_REDUCTION_VL, "MulReductionVL");
1628     }
1629 
1630     public static final String MIN_REDUCTION_V = PREFIX + "MIN_REDUCTION_V" + POSTFIX;
1631     static {
1632         superWordNodes(MIN_REDUCTION_V, "MinReductionV");
1633     }
1634 
1635     public static final String MAX_REDUCTION_V = PREFIX + "MAX_REDUCTION_V" + POSTFIX;
1636     static {
1637         superWordNodes(MAX_REDUCTION_V, "MaxReductionV");
1638     }
1639 
1640     public static final String UMIN_REDUCTION_V = PREFIX + "UMIN_REDUCTION_V" + POSTFIX;
1641     static {
1642         superWordNodes(UMIN_REDUCTION_V, "UMinReductionV");
1643     }
1644 
1645     public static final String UMAX_REDUCTION_V = PREFIX + "UMAX_REDUCTION_V" + POSTFIX;
1646     static {
1647         superWordNodes(UMAX_REDUCTION_V, "UMaxReductionV");
1648     }
1649 
1650     public static final String NEG_VF = VECTOR_PREFIX + "NEG_VF" + POSTFIX;
1651     static {
1652         vectorNode(NEG_VF, "NegVF", TYPE_FLOAT);
1653     }
1654 
1655     public static final String NEG_VD = VECTOR_PREFIX + "NEG_VD" + POSTFIX;
1656     static {
1657         vectorNode(NEG_VD, "NegVD", TYPE_DOUBLE);
1658     }
1659 
1660     public static final String NOP = PREFIX + "NOP" + POSTFIX;
1661     static {
1662         machOnlyNameRegex(NOP, "Nop");
1663     }
1664 
1665     public static final String NULL_ASSERT_TRAP = PREFIX + "NULL_ASSERT_TRAP" + POSTFIX;
1666     static {
1667         trapNodes(NULL_ASSERT_TRAP, "null_assert");
1668     }
1669 
1670     public static final String NULL_CHECK = PREFIX + "NULL_CHECK" + POSTFIX;
1671     static {
1672         machOnlyNameRegex(NULL_CHECK, "NullCheck");
1673     }
1674 
1675     public static final String NULL_CHECK_TRAP = PREFIX + "NULL_CHECK_TRAP" + POSTFIX;
1676     static {
1677         trapNodes(NULL_CHECK_TRAP, "null_check");
1678     }
1679 
1680     public static final String OOPMAP_WITH = COMPOSITE_PREFIX + "OOPMAP_WITH" + POSTFIX;
1681     static {
1682         String regex = "(#\\s*OopMap\\s*\\{.*" + IS_REPLACED + ".*\\})";
1683         optoOnly(OOPMAP_WITH, regex);
1684     }
1685 
1686     public static final String OPAQUE_TEMPLATE_ASSERTION_PREDICATE = PREFIX + "OPAQUE_TEMPLATE_ASSERTION_PREDICATE" + POSTFIX;
1687     static {
1688         duringLoopOpts(OPAQUE_TEMPLATE_ASSERTION_PREDICATE, "OpaqueTemplateAssertionPredicate");
1689     }
1690 
1691     public static final String OR_I = PREFIX + "OR_I" + POSTFIX;
1692     static {
1693         beforeMatchingNameRegex(OR_I, "OrI");
1694     }
1695 
1696     public static final String OR_L = PREFIX + "OR_L" + POSTFIX;
1697     static {
1698         beforeMatchingNameRegex(OR_L, "OrL");
1699     }
1700 
1701     public static final String OR_VB = VECTOR_PREFIX + "OR_VB" + POSTFIX;
1702     static {
1703         vectorNode(OR_VB, "OrV", TYPE_BYTE);
1704     }
1705 
1706     public static final String OR_VS = VECTOR_PREFIX + "OR_VS" + POSTFIX;
1707     static {
1708         vectorNode(OR_VS, "OrV", TYPE_SHORT);
1709     }
1710 
1711     public static final String OR_VI = VECTOR_PREFIX + "OR_VI" + POSTFIX;
1712     static {
1713         vectorNode(OR_VI, "OrV", TYPE_INT);
1714     }
1715 
1716     public static final String OR_VL = VECTOR_PREFIX + "OR_VL" + POSTFIX;
1717     static {
1718         vectorNode(OR_VL, "OrV", TYPE_LONG);
1719     }
1720 
1721     public static final String OR_V_MASK = PREFIX + "OR_V_MASK" + POSTFIX;
1722     static {
1723         beforeMatchingNameRegex(OR_V_MASK, "OrVMask");
1724     }
1725 
1726     public static final String OR_REDUCTION_V = PREFIX + "OR_REDUCTION_V" + POSTFIX;
1727     static {
1728         superWordNodes(OR_REDUCTION_V, "OrReductionV");
1729     }
1730 
1731     public static final String OUTER_STRIP_MINED_LOOP = PREFIX + "OUTER_STRIP_MINED_LOOP" + POSTFIX;
1732     static {
1733         String regex = START + "OuterStripMinedLoop\\b" + MID + END;
1734         fromAfterCountedLoops(OUTER_STRIP_MINED_LOOP, regex);
1735     }
1736 
1737     public static final String PARTIAL_SUBTYPE_CHECK = PREFIX + "PARTIAL_SUBTYPE_CHECK" + POSTFIX;
1738     static {
1739         beforeMatchingNameRegex(PARTIAL_SUBTYPE_CHECK, "PartialSubtypeCheck");
1740     }
1741 
1742     public static final String PHI = PREFIX + "PHI" + POSTFIX;
1743     static {
1744         beforeMatchingNameRegex(PHI, "Phi");
1745     }
1746 
1747     public static final String POPCOUNT_I = PREFIX + "POPCOUNT_I" + POSTFIX;
1748     static {
1749         beforeMatchingNameRegex(POPCOUNT_I, "PopCountI");
1750     }
1751 
1752     public static final String POPCOUNT_L = PREFIX + "POPCOUNT_L" + POSTFIX;
1753     static {
1754         beforeMatchingNameRegex(POPCOUNT_L, "PopCountL");
1755     }
1756 
1757     public static final String POPCOUNT_VI = VECTOR_PREFIX + "POPCOUNT_VI" + POSTFIX;
1758     static {
1759         vectorNode(POPCOUNT_VI, "PopCountVI", TYPE_INT);
1760     }
1761 
1762     public static final String POPCOUNT_VL = VECTOR_PREFIX + "POPCOUNT_VL" + POSTFIX;
1763     static {
1764         vectorNode(POPCOUNT_VL, "PopCountVL", TYPE_LONG);
1765     }
1766 
1767     public static final String COUNT_TRAILING_ZEROS_I = PREFIX + "COUNT_TRAILING_ZEROS_I" + POSTFIX;
1768     static {
1769         beforeMatchingNameRegex(COUNT_TRAILING_ZEROS_I, "CountTrailingZerosI");
1770     }
1771 
1772     public static final String COUNT_TRAILING_ZEROS_L = PREFIX + "COUNT_TRAILING_ZEROS_L" + POSTFIX;
1773     static {
1774         beforeMatchingNameRegex(COUNT_TRAILING_ZEROS_L, "CountTrailingZerosL");
1775     }
1776 
1777     public static final String COUNT_TRAILING_ZEROS_VL = VECTOR_PREFIX + "COUNT_TRAILING_ZEROS_VL" + POSTFIX;
1778     static {
1779         vectorNode(COUNT_TRAILING_ZEROS_VL, "CountTrailingZerosV", TYPE_LONG);
1780     }
1781 
1782     public static final String COUNT_TRAILING_ZEROS_VI = VECTOR_PREFIX + "COUNT_TRAILING_ZEROS_VI" + POSTFIX;
1783     static {
1784         vectorNode(COUNT_TRAILING_ZEROS_VI, "CountTrailingZerosV", TYPE_INT);
1785     }
1786 
1787     public static final String COUNT_LEADING_ZEROS_I = PREFIX + "COUNT_LEADING_ZEROS_I" + POSTFIX;
1788     static {
1789         beforeMatchingNameRegex(COUNT_LEADING_ZEROS_I, "CountLeadingZerosI");
1790     }
1791 
1792     public static final String COUNT_LEADING_ZEROS_L = PREFIX + "COUNT_LEADING_ZEROS_L" + POSTFIX;
1793     static {
1794         beforeMatchingNameRegex(COUNT_LEADING_ZEROS_L, "CountLeadingZerosL");
1795     }
1796 
1797     public static final String COUNT_LEADING_ZEROS_VL = VECTOR_PREFIX + "COUNT_LEADING_ZEROS_VL" + POSTFIX;
1798     static {
1799         vectorNode(COUNT_LEADING_ZEROS_VL, "CountLeadingZerosV", TYPE_LONG);
1800     }
1801 
1802     public static final String COUNT_LEADING_ZEROS_VI = VECTOR_PREFIX + "COUNT_LEADING_ZEROS_VI" + POSTFIX;
1803     static {
1804         vectorNode(COUNT_LEADING_ZEROS_VI, "CountLeadingZerosV", TYPE_INT);
1805     }
1806 
1807     public static final String POPULATE_INDEX = PREFIX + "POPULATE_INDEX" + POSTFIX;
1808     static {
1809         String regex = START + "PopulateIndex" + MID + END;
1810         IR_NODE_MAPPINGS.put(POPULATE_INDEX, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
1811                                                                        CompilePhase.AFTER_CLOOPS,
1812                                                                        CompilePhase.BEFORE_MATCHING));
1813     }
1814 
1815     public static final String LOOP_PARSE_PREDICATE = PREFIX + "LOOP_PARSE_PREDICATE" + POSTFIX;
1816     static {
1817         parsePredicateNodes(LOOP_PARSE_PREDICATE, "Loop");
1818     }
1819 
1820     public static final String LOOP_LIMIT_CHECK_PARSE_PREDICATE = PREFIX + "LOOP_LIMIT_CHECK_PARSE_PREDICATE" + POSTFIX;
1821     static {
1822         parsePredicateNodes(LOOP_LIMIT_CHECK_PARSE_PREDICATE, "Loop_Limit_Check");
1823     }
1824 
1825     public static final String PROFILED_LOOP_PARSE_PREDICATE = PREFIX + "PROFILED_LOOP_PARSE_PREDICATE" + POSTFIX;
1826     static {
1827         parsePredicateNodes(PROFILED_LOOP_PARSE_PREDICATE, "Profiled_Loop");
1828     }
1829 
1830     public static final String AUTO_VECTORIZATION_CHECK_PARSE_PREDICATE = PREFIX + "AUTO_VECTORIZATION_CHECK_PARSE_PREDICATE" + POSTFIX;
1831     static {
1832         parsePredicateNodes(AUTO_VECTORIZATION_CHECK_PARSE_PREDICATE, "Auto_Vectorization_Check");
1833     }
1834 
1835     public static final String PREDICATE_TRAP = PREFIX + "PREDICATE_TRAP" + POSTFIX;
1836     static {
1837         trapNodes(PREDICATE_TRAP, "predicate");
1838     }
1839 
1840     public static final String RANGE_CHECK_TRAP = PREFIX + "RANGE_CHECK_TRAP" + POSTFIX;
1841     static {
1842         trapNodes(RANGE_CHECK_TRAP, "range_check");
1843     }
1844 
1845     public static final String SHORT_RUNNING_LOOP_TRAP = PREFIX + "SHORT_RUNNING_LOOP_TRAP" + POSTFIX;
1846     static {
1847         trapNodes(SHORT_RUNNING_LOOP_TRAP, "short_running_loop");
1848     }
1849 
1850     public static final String REINTERPRET_S2HF = PREFIX + "REINTERPRET_S2HF" + POSTFIX;
1851     static {
1852         beforeMatchingNameRegex(REINTERPRET_S2HF, "ReinterpretS2HF");
1853     }
1854 
1855     public static final String REINTERPRET_HF2S = PREFIX + "REINTERPRET_HF2S" + POSTFIX;
1856     static {
1857         beforeMatchingNameRegex(REINTERPRET_HF2S, "ReinterpretHF2S");
1858     }
1859 
1860     public static final String REPLICATE_B = VECTOR_PREFIX + "REPLICATE_B" + POSTFIX;
1861     static {
1862         vectorNode(REPLICATE_B, "Replicate", TYPE_BYTE);
1863     }
1864 
1865     public static final String REPLICATE_S = VECTOR_PREFIX + "REPLICATE_S" + POSTFIX;
1866     static {
1867         vectorNode(REPLICATE_S, "Replicate", TYPE_SHORT);
1868     }
1869 
1870     public static final String REPLICATE_I = VECTOR_PREFIX + "REPLICATE_I" + POSTFIX;
1871     static {
1872         vectorNode(REPLICATE_I, "Replicate", TYPE_INT);
1873     }
1874 
1875     public static final String REPLICATE_L = VECTOR_PREFIX + "REPLICATE_L" + POSTFIX;
1876     static {
1877         vectorNode(REPLICATE_L, "Replicate", TYPE_LONG);
1878     }
1879 
1880     public static final String REPLICATE_F = VECTOR_PREFIX + "REPLICATE_F" + POSTFIX;
1881     static {
1882         vectorNode(REPLICATE_F, "Replicate", TYPE_FLOAT);
1883     }
1884 
1885     public static final String REPLICATE_D = VECTOR_PREFIX + "REPLICATE_D" + POSTFIX;
1886     static {
1887         vectorNode(REPLICATE_D, "Replicate", TYPE_DOUBLE);
1888     }
1889 
1890     public static final String REVERSE_BYTES_I = PREFIX + "REVERSE_BYTES_I" + POSTFIX;
1891     static {
1892         beforeMatchingNameRegex(REVERSE_BYTES_I, "ReverseBytesI");
1893     }
1894 
1895     public static final String REVERSE_BYTES_L = PREFIX + "REVERSE_BYTES_L" + POSTFIX;
1896     static {
1897         beforeMatchingNameRegex(REVERSE_BYTES_L, "ReverseBytesL");
1898     }
1899 
1900     public static final String REVERSE_BYTES_S = PREFIX + "REVERSE_BYTES_S" + POSTFIX;
1901     static {
1902         beforeMatchingNameRegex(REVERSE_BYTES_S, "ReverseBytesS");
1903     }
1904 
1905     public static final String REVERSE_BYTES_US = PREFIX + "REVERSE_BYTES_US" + POSTFIX;
1906     static {
1907         beforeMatchingNameRegex(REVERSE_BYTES_US, "ReverseBytesUS");
1908     }
1909 
1910     public static final String REVERSE_BYTES_VB = VECTOR_PREFIX + "REVERSE_BYTES_VB" + POSTFIX;
1911     static {
1912         vectorNode(REVERSE_BYTES_VB, "ReverseBytesV", TYPE_BYTE);
1913     }
1914 
1915     public static final String REVERSE_BYTES_VS = VECTOR_PREFIX + "REVERSE_BYTES_VS" + POSTFIX;
1916     static {
1917         vectorNode(REVERSE_BYTES_VS, "ReverseBytesV", TYPE_SHORT);
1918     }
1919 
1920     public static final String REVERSE_BYTES_VI = VECTOR_PREFIX + "REVERSE_BYTES_VI" + POSTFIX;
1921     static {
1922         vectorNode(REVERSE_BYTES_VI, "ReverseBytesV", TYPE_INT);
1923     }
1924 
1925     public static final String REVERSE_BYTES_VL = VECTOR_PREFIX + "REVERSE_BYTES_VL" + POSTFIX;
1926     static {
1927         vectorNode(REVERSE_BYTES_VL, "ReverseBytesV", TYPE_LONG);
1928     }
1929 
1930     public static final String REVERSE_I = PREFIX + "REVERSE_I" + POSTFIX;
1931     static {
1932         beforeMatchingNameRegex(REVERSE_I, "ReverseI");
1933     }
1934 
1935     public static final String REVERSE_L = PREFIX + "REVERSE_L" + POSTFIX;
1936     static {
1937         beforeMatchingNameRegex(REVERSE_L, "ReverseL");
1938     }
1939 
1940     public static final String REVERSE_VI = VECTOR_PREFIX + "REVERSE_VI" + POSTFIX;
1941     static {
1942         vectorNode(REVERSE_VI, "ReverseV", TYPE_INT);
1943     }
1944 
1945     public static final String REVERSE_VL = VECTOR_PREFIX + "REVERSE_VL" + POSTFIX;
1946     static {
1947         vectorNode(REVERSE_VL, "ReverseV", TYPE_LONG);
1948     }
1949 
1950     public static final String ROUND_VD = VECTOR_PREFIX + "ROUND_VD" + POSTFIX;
1951     static {
1952         vectorNode(ROUND_VD, "RoundVD", TYPE_LONG);
1953     }
1954 
1955     public static final String ROUND_VF = VECTOR_PREFIX + "ROUND_VF" + POSTFIX;
1956     static {
1957         vectorNode(ROUND_VF, "RoundVF", TYPE_INT);
1958     }
1959 
1960     public static final String ROTATE_LEFT = PREFIX + "ROTATE_LEFT" + POSTFIX;
1961     static {
1962         beforeMatchingNameRegex(ROTATE_LEFT, "RotateLeft");
1963     }
1964 
1965     public static final String ROTATE_RIGHT = PREFIX + "ROTATE_RIGHT" + POSTFIX;
1966     static {
1967         beforeMatchingNameRegex(ROTATE_RIGHT, "RotateRight");
1968     }
1969 
1970     public static final String ROTATE_LEFT_V = PREFIX + "ROTATE_LEFT_V" + POSTFIX;
1971     static {
1972         beforeMatchingNameRegex(ROTATE_LEFT_V, "RotateLeftV");
1973     }
1974 
1975     public static final String ROTATE_RIGHT_V = PREFIX + "ROTATE_RIGHT_V" + POSTFIX;
1976     static {
1977         beforeMatchingNameRegex(ROTATE_RIGHT_V, "RotateRightV");
1978     }
1979 
1980     public static final String ROUND_DOUBLE_MODE_V = VECTOR_PREFIX + "ROUND_DOUBLE_MODE_V" + POSTFIX;
1981     static {
1982         vectorNode(ROUND_DOUBLE_MODE_V, "RoundDoubleModeV", TYPE_DOUBLE);
1983     }
1984 
1985     public static final String RSHIFT = PREFIX + "RSHIFT" + POSTFIX;
1986     static {
1987         beforeMatchingNameRegex(RSHIFT, "RShift(I|L)");
1988     }
1989 
1990     public static final String RSHIFT_I = PREFIX + "RSHIFT_I" + POSTFIX;
1991     static {
1992         beforeMatchingNameRegex(RSHIFT_I, "RShiftI");
1993     }
1994 
1995     public static final String RSHIFT_L = PREFIX + "RSHIFT_L" + POSTFIX;
1996     static {
1997         beforeMatchingNameRegex(RSHIFT_L, "RShiftL");
1998     }
1999 
2000     public static final String RSHIFT_VB = VECTOR_PREFIX + "RSHIFT_VB" + POSTFIX;
2001     static {
2002         vectorNode(RSHIFT_VB, "RShiftVB", TYPE_BYTE);
2003     }
2004 
2005     public static final String RSHIFT_VS = VECTOR_PREFIX + "RSHIFT_VS" + POSTFIX;
2006     static {
2007         vectorNode(RSHIFT_VS, "RShiftVS", TYPE_SHORT);
2008     }
2009 
2010     public static final String RSHIFT_VC = VECTOR_PREFIX + "RSHIFT_VC" + POSTFIX;
2011     static {
2012         vectorNode(RSHIFT_VC, "RShiftVS", TYPE_CHAR); // short computation with char type
2013     }
2014 
2015     public static final String RSHIFT_VI = VECTOR_PREFIX + "RSHIFT_VI" + POSTFIX;
2016     static {
2017         vectorNode(RSHIFT_VI, "RShiftVI", TYPE_INT);
2018     }
2019 
2020     public static final String RSHIFT_VL = VECTOR_PREFIX + "RSHIFT_VL" + POSTFIX;
2021     static {
2022         vectorNode(RSHIFT_VL, "RShiftVL", TYPE_LONG);
2023     }
2024 
2025     public static final String SAFEPOINT = PREFIX + "SAFEPOINT" + POSTFIX;
2026     static {
2027         beforeMatchingNameRegex(SAFEPOINT, "SafePoint");
2028     }
2029 
2030     public static final String SCOPE_OBJECT = PREFIX + "SCOPE_OBJECT" + POSTFIX;
2031     static {
2032         String regex = "(.*# ScObj.*" + END;
2033         optoOnly(SCOPE_OBJECT, regex);
2034     }
2035 
2036     public static final String SAFEPOINT_SCALAROBJECT_OF = COMPOSITE_PREFIX + "SAFEPOINT_SCALAROBJECT_OF" + POSTFIX;
2037     static {
2038         safepointScalarobjectOfNodes(SAFEPOINT_SCALAROBJECT_OF, "SafePointScalarObject");
2039     }
2040 
2041     public static final String SIGNUM_VD = VECTOR_PREFIX + "SIGNUM_VD" + POSTFIX;
2042     static {
2043         vectorNode(SIGNUM_VD, "SignumVD", TYPE_DOUBLE);
2044     }
2045 
2046     public static final String SIGNUM_VF = VECTOR_PREFIX + "SIGNUM_VF" + POSTFIX;
2047     static {
2048         vectorNode(SIGNUM_VF, "SignumVF", TYPE_FLOAT);
2049     }
2050 
2051     public static final String SQRT_VHF = VECTOR_PREFIX + "SQRT_VHF" + POSTFIX;
2052     static {
2053         vectorNode(SQRT_VHF, "SqrtVHF", TYPE_SHORT);
2054     }
2055 
2056     public static final String SQRT_HF = PREFIX + "SQRT_HF" + POSTFIX;
2057     static {
2058        beforeMatchingNameRegex(SQRT_HF, "SqrtHF");
2059     }
2060 
2061     public static final String SQRT_D = PREFIX + "SQRT_D" + POSTFIX;
2062     static {
2063         beforeMatchingNameRegex(SQRT_D, "SqrtD");
2064     }
2065 
2066     public static final String SQRT_F = PREFIX + "SQRT_F" + POSTFIX;
2067     static {
2068        beforeMatchingNameRegex(SQRT_F, "SqrtF");
2069     }
2070 
2071     public static final String SQRT_VF = VECTOR_PREFIX + "SQRT_VF" + POSTFIX;
2072     static {
2073         vectorNode(SQRT_VF, "SqrtVF", TYPE_FLOAT);
2074     }
2075 
2076     public static final String SQRT_VD = VECTOR_PREFIX + "SQRT_VD" + POSTFIX;
2077     static {
2078         vectorNode(SQRT_VD, "SqrtVD", TYPE_DOUBLE);
2079     }
2080 
2081     public static final String STORE = PREFIX + "STORE" + POSTFIX;
2082     static {
2083         beforeMatchingNameRegex(STORE, "Store(B|C|S|I|L|F|D|P|N)");
2084     }
2085 
2086     public static final String STORE_B = PREFIX + "STORE_B" + POSTFIX;
2087     static {
2088         beforeMatchingNameRegex(STORE_B, "StoreB");
2089     }
2090 
2091     public static final String STORE_B_OF_CLASS = COMPOSITE_PREFIX + "STORE_B_OF_CLASS" + POSTFIX;
2092     static {
2093         storeOfNodes(STORE_B_OF_CLASS, "StoreB", IS_REPLACED);
2094     }
2095 
2096     public static final String STORE_C = PREFIX + "STORE_C" + POSTFIX;
2097     static {
2098         beforeMatchingNameRegex(STORE_C, "StoreC");
2099     }
2100 
2101     public static final String STORE_C_OF_CLASS = COMPOSITE_PREFIX + "STORE_C_OF_CLASS" + POSTFIX;
2102     static {
2103         storeOfNodes(STORE_C_OF_CLASS, "StoreC", IS_REPLACED);
2104     }
2105 
2106     public static final String STORE_D = PREFIX + "STORE_D" + POSTFIX;
2107     static {
2108         beforeMatchingNameRegex(STORE_D, "StoreD");
2109     }
2110 
2111     public static final String STORE_D_OF_CLASS = COMPOSITE_PREFIX + "STORE_D_OF_CLASS" + POSTFIX;
2112     static {
2113         storeOfNodes(STORE_D_OF_CLASS, "StoreD", IS_REPLACED);
2114     }
2115 
2116     public static final String STORE_F = PREFIX + "STORE_F" + POSTFIX;
2117     static {
2118         beforeMatchingNameRegex(STORE_F, "StoreF");
2119     }
2120 
2121     public static final String STORE_F_OF_CLASS = COMPOSITE_PREFIX + "STORE_F_OF_CLASS" + POSTFIX;
2122     static {
2123         storeOfNodes(STORE_F_OF_CLASS, "StoreF", IS_REPLACED);
2124     }
2125 
2126     public static final String STORE_I = PREFIX + "STORE_I" + POSTFIX;
2127     static {
2128         beforeMatchingNameRegex(STORE_I, "StoreI");
2129     }
2130 
2131     public static final String STORE_I_OF_CLASS = COMPOSITE_PREFIX + "STORE_I_OF_CLASS" + POSTFIX;
2132     static {
2133         storeOfNodes(STORE_I_OF_CLASS, "StoreI", IS_REPLACED);
2134     }
2135 
2136     public static final String STORE_L = PREFIX + "STORE_L" + POSTFIX;
2137     static {
2138         beforeMatchingNameRegex(STORE_L, "StoreL");
2139     }
2140 
2141     public static final String STORE_L_OF_CLASS = COMPOSITE_PREFIX + "STORE_L_OF_CLASS" + POSTFIX;
2142     static {
2143         storeOfNodes(STORE_L_OF_CLASS, "StoreL", IS_REPLACED);
2144     }
2145 
2146     public static final String STORE_N = PREFIX + "STORE_N" + POSTFIX;
2147     static {
2148         beforeMatchingNameRegex(STORE_N, "StoreN");
2149     }
2150 
2151     public static final String STORE_N_OF_CLASS = COMPOSITE_PREFIX + "STORE_N_OF_CLASS" + POSTFIX;
2152     static {
2153         storeOfNodes(STORE_N_OF_CLASS, "StoreN", IS_REPLACED);
2154     }
2155 
2156     public static final String STORE_OF_CLASS = COMPOSITE_PREFIX + "STORE_OF_CLASS" + POSTFIX;
2157     static {
2158         anyStoreOfNodes(STORE_OF_CLASS, IS_REPLACED);
2159     }
2160 
2161     public static void anyStoreOfNodes(String irNodePlaceholder, String fieldHolder) {
2162         storeOfNodes(irNodePlaceholder, "Store(B|C|S|I|L|F|D|P|N)", fieldHolder);
2163     }
2164 
2165     public static final String STORE_OF_FIELD = COMPOSITE_PREFIX + "STORE_OF_FIELD" + POSTFIX;
2166     static {
2167         String regex = START + "Store(B|C|S|I|L|F|D|P|N)" + MID + "@.*name=" + IS_REPLACED + ",.*" + END;
2168         beforeMatching(STORE_OF_FIELD, regex);
2169     }
2170 
2171     public static final String STORE_P = PREFIX + "STORE_P" + POSTFIX;
2172     static {
2173         beforeMatchingNameRegex(STORE_P, "StoreP");
2174     }
2175 
2176     public static final String STORE_P_OF_CLASS = COMPOSITE_PREFIX + "STORE_P_OF_CLASS" + POSTFIX;
2177     static {
2178         storeOfNodes(STORE_P_OF_CLASS, "StoreP", IS_REPLACED);
2179     }
2180 
2181     public static final String STORE_VECTOR = PREFIX + "STORE_VECTOR" + POSTFIX;
2182     static {
2183         beforeMatchingNameRegex(STORE_VECTOR, "StoreVector");
2184     }
2185 
2186     public static final String STORE_VECTOR_SCATTER = PREFIX + "STORE_VECTOR_SCATTER" + POSTFIX;
2187     static {
2188         beforeMatchingNameRegex(STORE_VECTOR_SCATTER, "StoreVectorScatter");
2189     }
2190 
2191     public static final String STORE_VECTOR_MASKED = PREFIX + "STORE_VECTOR_MASKED" + POSTFIX;
2192     static {
2193         beforeMatchingNameRegex(STORE_VECTOR_MASKED, "StoreVectorMasked");
2194     }
2195 
2196     public static final String STORE_VECTOR_SCATTER_MASKED = PREFIX + "STORE_VECTOR_SCATTER_MASKED" + POSTFIX;
2197     static {
2198         beforeMatchingNameRegex(STORE_VECTOR_SCATTER_MASKED, "StoreVectorScatterMasked");
2199     }
2200 
2201     public static final String VECTOR_LOAD_MASK = PREFIX + "VECTOR_LOAD_MASK" + POSTFIX;
2202     static {
2203         beforeMatchingNameRegex(VECTOR_LOAD_MASK, "VectorLoadMask");
2204     }
2205 
2206     public static final String VECTOR_STORE_MASK = PREFIX + "VECTOR_STORE_MASK" + POSTFIX;
2207     static {
2208         beforeMatchingNameRegex(VECTOR_STORE_MASK, "VectorStoreMask");
2209     }
2210 
2211     public static final String SUB = PREFIX + "SUB" + POSTFIX;
2212     static {
2213         beforeMatchingNameRegex(SUB, "Sub(I|L|F|D|HF)");
2214     }
2215 
2216     public static final String SUB_D = PREFIX + "SUB_D" + POSTFIX;
2217     static {
2218         beforeMatchingNameRegex(SUB_D, "SubD");
2219     }
2220 
2221     public static final String SUB_F = PREFIX + "SUB_F" + POSTFIX;
2222     static {
2223         beforeMatchingNameRegex(SUB_F, "SubF");
2224     }
2225 
2226     public static final String SUB_HF = PREFIX + "SUB_HF" + POSTFIX;
2227     static {
2228         beforeMatchingNameRegex(SUB_HF, "SubHF");
2229     }
2230 
2231     public static final String SUB_I = PREFIX + "SUB_I" + POSTFIX;
2232     static {
2233         beforeMatchingNameRegex(SUB_I, "SubI");
2234     }
2235 
2236     public static final String SUB_L = PREFIX + "SUB_L" + POSTFIX;
2237     static {
2238         beforeMatchingNameRegex(SUB_L, "SubL");
2239     }
2240 
2241     public static final String SUB_VB = VECTOR_PREFIX + "SUB_VB" + POSTFIX;
2242     static {
2243         vectorNode(SUB_VB, "SubVB", TYPE_BYTE);
2244     }
2245 
2246     public static final String SUB_VS = VECTOR_PREFIX + "SUB_VS" + POSTFIX;
2247     static {
2248         vectorNode(SUB_VS, "SubVS", TYPE_SHORT);
2249     }
2250 
2251     public static final String SUB_VI = VECTOR_PREFIX + "SUB_VI" + POSTFIX;
2252     static {
2253         vectorNode(SUB_VI, "SubVI", TYPE_INT);
2254     }
2255 
2256     public static final String SUB_VL = VECTOR_PREFIX + "SUB_VL" + POSTFIX;
2257     static {
2258         vectorNode(SUB_VL, "SubVL", TYPE_LONG);
2259     }
2260 
2261     public static final String SUB_VHF = VECTOR_PREFIX + "SUB_VHF" + POSTFIX;
2262     static {
2263         vectorNode(SUB_VHF, "SubVHF", TYPE_SHORT);
2264     }
2265 
2266     public static final String SUB_VF = VECTOR_PREFIX + "SUB_VF" + POSTFIX;
2267     static {
2268         vectorNode(SUB_VF, "SubVF", TYPE_FLOAT);
2269     }
2270 
2271     public static final String SUB_VD = VECTOR_PREFIX + "SUB_VD" + POSTFIX;
2272     static {
2273         vectorNode(SUB_VD, "SubVD", TYPE_DOUBLE);
2274     }
2275 
2276     public static final String SUBTYPE_CHECK = PREFIX + "SUBTYPE_CHECK" + POSTFIX;
2277     static {
2278         String regex = START + "SubTypeCheck" + MID + END;
2279         macroNodes(SUBTYPE_CHECK, regex);
2280     }
2281 
2282     public static final String TRAP = PREFIX + "TRAP" + POSTFIX;
2283     static {
2284         trapNodes(TRAP, "reason");
2285     }
2286 
2287     public static final String DIV_HF = PREFIX + "DIV_HF" + POSTFIX;
2288     static {
2289         beforeMatchingNameRegex(DIV_HF, "DivHF");
2290     }
2291 
2292     public static final String UDIV_I = PREFIX + "UDIV_I" + POSTFIX;
2293     static {
2294         beforeMatchingNameRegex(UDIV_I, "UDivI");
2295     }
2296 
2297     public static final String UDIV_L = PREFIX + "UDIV_L" + POSTFIX;
2298     static {
2299         beforeMatchingNameRegex(UDIV_L, "UDivL");
2300     }
2301 
2302     public static final String UDIV_MOD_I = PREFIX + "UDIV_MOD_I" + POSTFIX;
2303     static {
2304         beforeMatchingNameRegex(UDIV_MOD_I, "UDivModI");
2305     }
2306 
2307     public static final String UDIV_MOD_L = PREFIX + "UDIV_MOD_L" + POSTFIX;
2308     static {
2309         beforeMatchingNameRegex(UDIV_MOD_L, "UDivModL");
2310     }
2311 
2312     public static final String UMOD_I = PREFIX + "UMOD_I" + POSTFIX;
2313     static {
2314         beforeMatchingNameRegex(UMOD_I, "UModI");
2315     }
2316 
2317     public static final String UMOD_L = PREFIX + "UMOD_L" + POSTFIX;
2318     static {
2319         beforeMatchingNameRegex(UMOD_L, "UModL");
2320     }
2321 
2322     public static final String UNHANDLED_TRAP = PREFIX + "UNHANDLED_TRAP" + POSTFIX;
2323     static {
2324         trapNodes(UNHANDLED_TRAP, "unhandled");
2325     }
2326 
2327     public static final String UNSTABLE_IF_TRAP = PREFIX + "UNSTABLE_IF_TRAP" + POSTFIX;
2328     static {
2329         trapNodes(UNSTABLE_IF_TRAP, "unstable_if");
2330     }
2331 
2332     public static final String UNREACHED_TRAP = PREFIX + "UNREACHED_TRAP" + POSTFIX;
2333     static {
2334         trapNodes(UNREACHED_TRAP, "unreached");
2335     }
2336 
2337     public static final String URSHIFT = PREFIX + "URSHIFT" + POSTFIX;
2338     static {
2339         beforeMatchingNameRegex(URSHIFT, "URShift(B|S|I|L)");
2340     }
2341 
2342     public static final String URSHIFT_B = PREFIX + "URSHIFT_B" + POSTFIX;
2343     static {
2344         beforeMatchingNameRegex(URSHIFT_B, "URShiftB");
2345     }
2346 
2347     public static final String URSHIFT_I = PREFIX + "URSHIFT_I" + POSTFIX;
2348     static {
2349         beforeMatchingNameRegex(URSHIFT_I, "URShiftI");
2350     }
2351 
2352     public static final String URSHIFT_L = PREFIX + "URSHIFT_L" + POSTFIX;
2353     static {
2354         beforeMatchingNameRegex(URSHIFT_L, "URShiftL");
2355     }
2356 
2357     public static final String URSHIFT_S = PREFIX + "URSHIFT_S" + POSTFIX;
2358     static {
2359         beforeMatchingNameRegex(URSHIFT_S, "URShiftS");
2360     }
2361 
2362     public static final String URSHIFT_VB = VECTOR_PREFIX + "URSHIFT_VB" + POSTFIX;
2363     static {
2364         vectorNode(URSHIFT_VB, "URShiftVB", TYPE_BYTE);
2365     }
2366 
2367     public static final String URSHIFT_VS = VECTOR_PREFIX + "URSHIFT_VS" + POSTFIX;
2368     static {
2369         vectorNode(URSHIFT_VS, "URShiftVS", TYPE_SHORT);
2370     }
2371 
2372     public static final String URSHIFT_VC = VECTOR_PREFIX + "URSHIFT_VC" + POSTFIX;
2373     static {
2374         vectorNode(URSHIFT_VC, "URShiftVS", TYPE_CHAR); // short computation with char type
2375     }
2376 
2377     public static final String URSHIFT_VI = VECTOR_PREFIX + "URSHIFT_VI" + POSTFIX;
2378     static {
2379         vectorNode(URSHIFT_VI, "URShiftVI", TYPE_INT);
2380     }
2381 
2382     public static final String URSHIFT_VL = VECTOR_PREFIX + "URSHIFT_VL" + POSTFIX;
2383     static {
2384         vectorNode(URSHIFT_VL, "URShiftVL", TYPE_LONG);
2385     }
2386 
2387     public static final String VAND_NOT_I = PREFIX + "VAND_NOT_I" + POSTFIX;
2388     static {
2389         machOnlyNameRegex(VAND_NOT_I, "vand_notI");
2390     }
2391 
2392     public static final String VAND_NOT_L = PREFIX + "VAND_NOT_L" + POSTFIX;
2393     static {
2394         machOnlyNameRegex(VAND_NOT_L, "vand_notL");
2395     }
2396 
2397     public static final String VAND_NOT_I_MASKED = PREFIX + "VAND_NOT_I_MASKED" + POSTFIX;
2398     static {
2399         machOnlyNameRegex(VAND_NOT_I_MASKED, "vand_notI_masked");
2400     }
2401 
2402     public static final String VAND_NOT_L_MASKED = PREFIX + "VAND_NOT_L_MASKED" + POSTFIX;
2403     static {
2404         machOnlyNameRegex(VAND_NOT_L_MASKED, "vand_notL_masked");
2405     }
2406 
2407     public static final String RISCV_VAND_NOTI_VX = PREFIX + "RISCV_VAND_NOTI_VX" + POSTFIX;
2408     static {
2409         machOnlyNameRegex(RISCV_VAND_NOTI_VX, "vand_notI_vx");
2410     }
2411 
2412     public static final String RISCV_VAND_NOTL_VX = PREFIX + "RISCV_VAND_NOTL_VX" + POSTFIX;
2413     static {
2414         machOnlyNameRegex(RISCV_VAND_NOTL_VX, "vand_notL_vx");
2415     }
2416 
2417     public static final String RISCV_VAND_NOTI_VX_MASKED = PREFIX + "RISCV_VAND_NOTI_VX_MASKED" + POSTFIX;
2418     static {
2419         machOnlyNameRegex(RISCV_VAND_NOTI_VX_MASKED, "vand_notI_vx_masked");
2420     }
2421 
2422     public static final String RISCV_VAND_NOTL_VX_MASKED = PREFIX + "RISCV_VAND_NOTL_VX_MASKED" + POSTFIX;
2423     static {
2424         machOnlyNameRegex(RISCV_VAND_NOTL_VX_MASKED, "vand_notL_vx_masked");
2425     }
2426 
2427     public static final String VECTOR_BLEND_B = VECTOR_PREFIX + "VECTOR_BLEND_B" + POSTFIX;
2428     static {
2429         vectorNode(VECTOR_BLEND_B, "VectorBlend", TYPE_BYTE);
2430     }
2431 
2432     public static final String VECTOR_BLEND_S = VECTOR_PREFIX + "VECTOR_BLEND_S" + POSTFIX;
2433     static {
2434         vectorNode(VECTOR_BLEND_S, "VectorBlend", TYPE_SHORT);
2435     }
2436 
2437     public static final String VECTOR_BLEND_I = VECTOR_PREFIX + "VECTOR_BLEND_I" + POSTFIX;
2438     static {
2439         vectorNode(VECTOR_BLEND_I, "VectorBlend", TYPE_INT);
2440     }
2441 
2442     public static final String VECTOR_BLEND_L = VECTOR_PREFIX + "VECTOR_BLEND_L" + POSTFIX;
2443     static {
2444         vectorNode(VECTOR_BLEND_L, "VectorBlend", TYPE_LONG);
2445     }
2446 
2447     public static final String VECTOR_BLEND_F = VECTOR_PREFIX + "VECTOR_BLEND_F" + POSTFIX;
2448     static {
2449         vectorNode(VECTOR_BLEND_F, "VectorBlend", TYPE_FLOAT);
2450     }
2451 
2452     public static final String VECTOR_BLEND_D = VECTOR_PREFIX + "VECTOR_BLEND_D" + POSTFIX;
2453     static {
2454         vectorNode(VECTOR_BLEND_D, "VectorBlend", TYPE_DOUBLE);
2455     }
2456 
2457     public static final String VECTOR_MASK_CMP_I = VECTOR_PREFIX + "VECTOR_MASK_CMP_I" + POSTFIX;
2458     static {
2459         vectorNode(VECTOR_MASK_CMP_I, "VectorMaskCmp", TYPE_INT);
2460     }
2461 
2462     public static final String VECTOR_MASK_CMP_L = VECTOR_PREFIX + "VECTOR_MASK_CMP_L" + POSTFIX;
2463     static {
2464         vectorNode(VECTOR_MASK_CMP_L, "VectorMaskCmp", TYPE_LONG);
2465     }
2466 
2467     public static final String VECTOR_MASK_CMP_F = VECTOR_PREFIX + "VECTOR_MASK_CMP_F" + POSTFIX;
2468     static {
2469         vectorNode(VECTOR_MASK_CMP_F, "VectorMaskCmp", TYPE_FLOAT);
2470     }
2471 
2472     public static final String VECTOR_MASK_CMP_D = VECTOR_PREFIX + "VECTOR_MASK_CMP_D" + POSTFIX;
2473     static {
2474         vectorNode(VECTOR_MASK_CMP_D, "VectorMaskCmp", TYPE_DOUBLE);
2475     }
2476 
2477     public static final String VECTOR_MASK_CMP = PREFIX + "VECTOR_MASK_CMP" + POSTFIX;
2478     static {
2479         beforeMatchingNameRegex(VECTOR_MASK_CMP, "VectorMaskCmp");
2480     }
2481 
2482     public static final String VECTOR_CAST_B2S = VECTOR_PREFIX + "VECTOR_CAST_B2S" + POSTFIX;
2483     static {
2484         vectorNode(VECTOR_CAST_B2S, "VectorCastB2X", TYPE_SHORT);
2485     }
2486 
2487     public static final String VECTOR_CAST_B2I = VECTOR_PREFIX + "VECTOR_CAST_B2I" + POSTFIX;
2488     static {
2489         vectorNode(VECTOR_CAST_B2I, "VectorCastB2X", TYPE_INT);
2490     }
2491 
2492     public static final String VECTOR_CAST_B2L = VECTOR_PREFIX + "VECTOR_CAST_B2L" + POSTFIX;
2493     static {
2494         vectorNode(VECTOR_CAST_B2L, "VectorCastB2X", TYPE_LONG);
2495     }
2496 
2497     public static final String VECTOR_CAST_B2F = VECTOR_PREFIX + "VECTOR_CAST_B2F" + POSTFIX;
2498     static {
2499         vectorNode(VECTOR_CAST_B2F, "VectorCastB2X", TYPE_FLOAT);
2500     }
2501 
2502     public static final String VECTOR_CAST_B2D = VECTOR_PREFIX + "VECTOR_CAST_B2D" + POSTFIX;
2503     static {
2504         vectorNode(VECTOR_CAST_B2D, "VectorCastB2X", TYPE_DOUBLE);
2505     }
2506 
2507     public static final String VECTOR_CAST_D2B = VECTOR_PREFIX + "VECTOR_CAST_D2B" + POSTFIX;
2508     static {
2509         vectorNode(VECTOR_CAST_D2B, "VectorCastD2X", TYPE_BYTE);
2510     }
2511 
2512     public static final String VECTOR_CAST_D2S = VECTOR_PREFIX + "VECTOR_CAST_D2S" + POSTFIX;
2513     static {
2514         vectorNode(VECTOR_CAST_D2S, "VectorCastD2X", TYPE_SHORT);
2515     }
2516 
2517     public static final String VECTOR_CAST_D2I = VECTOR_PREFIX + "VECTOR_CAST_D2I" + POSTFIX;
2518     static {
2519         vectorNode(VECTOR_CAST_D2I, "VectorCastD2X", TYPE_INT);
2520     }
2521 
2522     public static final String VECTOR_CAST_D2L = VECTOR_PREFIX + "VECTOR_CAST_D2L" + POSTFIX;
2523     static {
2524         vectorNode(VECTOR_CAST_D2L, "VectorCastD2X", TYPE_LONG);
2525     }
2526 
2527     public static final String VECTOR_CAST_D2F = VECTOR_PREFIX + "VECTOR_CAST_D2F" + POSTFIX;
2528     static {
2529         vectorNode(VECTOR_CAST_D2F, "VectorCastD2X", TYPE_FLOAT);
2530     }
2531 
2532     public static final String VECTOR_CAST_F2B = VECTOR_PREFIX + "VECTOR_CAST_F2B" + POSTFIX;
2533     static {
2534         vectorNode(VECTOR_CAST_F2B, "VectorCastF2X", TYPE_BYTE);
2535     }
2536 
2537     public static final String VECTOR_CAST_F2S = VECTOR_PREFIX + "VECTOR_CAST_F2S" + POSTFIX;
2538     static {
2539         vectorNode(VECTOR_CAST_F2S, "VectorCastF2X", TYPE_SHORT);
2540     }
2541 
2542     public static final String VECTOR_CAST_F2I = VECTOR_PREFIX + "VECTOR_CAST_F2I" + POSTFIX;
2543     static {
2544         vectorNode(VECTOR_CAST_F2I, "VectorCastF2X", TYPE_INT);
2545     }
2546 
2547     public static final String VECTOR_CAST_F2L = VECTOR_PREFIX + "VECTOR_CAST_F2L" + POSTFIX;
2548     static {
2549         vectorNode(VECTOR_CAST_F2L, "VectorCastF2X", TYPE_LONG);
2550     }
2551 
2552     public static final String VECTOR_CAST_F2D = VECTOR_PREFIX + "VECTOR_CAST_F2D" + POSTFIX;
2553     static {
2554         vectorNode(VECTOR_CAST_F2D, "VectorCastF2X", TYPE_DOUBLE);
2555     }
2556 
2557     public static final String VECTOR_CAST_I2B = VECTOR_PREFIX + "VECTOR_CAST_I2B" + POSTFIX;
2558     static {
2559         vectorNode(VECTOR_CAST_I2B, "VectorCastI2X", TYPE_BYTE);
2560     }
2561 
2562     public static final String VECTOR_CAST_I2S = VECTOR_PREFIX + "VECTOR_CAST_I2S" + POSTFIX;
2563     static {
2564         vectorNode(VECTOR_CAST_I2S, "VectorCastI2X", TYPE_SHORT);
2565     }
2566 
2567     public static final String VECTOR_CAST_I2L = VECTOR_PREFIX + "VECTOR_CAST_I2L" + POSTFIX;
2568     static {
2569         vectorNode(VECTOR_CAST_I2L, "VectorCastI2X", TYPE_LONG);
2570     }
2571 
2572     public static final String VECTOR_CAST_I2F = VECTOR_PREFIX + "VECTOR_CAST_I2F" + POSTFIX;
2573     static {
2574         vectorNode(VECTOR_CAST_I2F, "VectorCastI2X", TYPE_FLOAT);
2575     }
2576 
2577     public static final String VECTOR_CAST_I2D = VECTOR_PREFIX + "VECTOR_CAST_I2D" + POSTFIX;
2578     static {
2579         vectorNode(VECTOR_CAST_I2D, "VectorCastI2X", TYPE_DOUBLE);
2580     }
2581 
2582     public static final String VECTOR_CAST_L2B = VECTOR_PREFIX + "VECTOR_CAST_L2B" + POSTFIX;
2583     static {
2584         vectorNode(VECTOR_CAST_L2B, "VectorCastL2X", TYPE_BYTE);
2585     }
2586 
2587     public static final String VECTOR_CAST_L2S = VECTOR_PREFIX + "VECTOR_CAST_L2S" + POSTFIX;
2588     static {
2589         vectorNode(VECTOR_CAST_L2S, "VectorCastL2X", TYPE_SHORT);
2590     }
2591 
2592     public static final String VECTOR_CAST_L2I = VECTOR_PREFIX + "VECTOR_CAST_L2I" + POSTFIX;
2593     static {
2594         vectorNode(VECTOR_CAST_L2I, "VectorCastL2X", TYPE_INT);
2595     }
2596 
2597     public static final String VECTOR_CAST_L2F = VECTOR_PREFIX + "VECTOR_CAST_L2F" + POSTFIX;
2598     static {
2599         vectorNode(VECTOR_CAST_L2F, "VectorCastL2X", TYPE_FLOAT);
2600     }
2601 
2602     public static final String VECTOR_CAST_L2D = VECTOR_PREFIX + "VECTOR_CAST_L2D" + POSTFIX;
2603     static {
2604         vectorNode(VECTOR_CAST_L2D, "VectorCastL2X", TYPE_DOUBLE);
2605     }
2606 
2607     public static final String VECTOR_CAST_S2B = VECTOR_PREFIX + "VECTOR_CAST_S2B" + POSTFIX;
2608     static {
2609         vectorNode(VECTOR_CAST_S2B, "VectorCastS2X", TYPE_BYTE);
2610     }
2611 
2612     public static final String VECTOR_CAST_S2I = VECTOR_PREFIX + "VECTOR_CAST_S2I" + POSTFIX;
2613     static {
2614         vectorNode(VECTOR_CAST_S2I, "VectorCastS2X", TYPE_INT);
2615     }
2616 
2617     public static final String VECTOR_CAST_S2L = VECTOR_PREFIX + "VECTOR_CAST_S2L" + POSTFIX;
2618     static {
2619         vectorNode(VECTOR_CAST_S2L, "VectorCastS2X", TYPE_LONG);
2620     }
2621 
2622     public static final String VECTOR_CAST_S2F = VECTOR_PREFIX + "VECTOR_CAST_S2F" + POSTFIX;
2623     static {
2624         vectorNode(VECTOR_CAST_S2F, "VectorCastS2X", TYPE_FLOAT);
2625     }
2626 
2627     public static final String VECTOR_CAST_S2D = VECTOR_PREFIX + "VECTOR_CAST_S2D" + POSTFIX;
2628     static {
2629         vectorNode(VECTOR_CAST_S2D, "VectorCastS2X", TYPE_DOUBLE);
2630     }
2631 
2632     public static final String VECTOR_CAST_F2HF = VECTOR_PREFIX + "VECTOR_CAST_F2HF" + POSTFIX;
2633     static {
2634         vectorNode(VECTOR_CAST_F2HF, "VectorCastF2HF", TYPE_SHORT);
2635     }
2636 
2637     public static final String VECTOR_CAST_HF2F = VECTOR_PREFIX + "VECTOR_CAST_HF2F" + POSTFIX;
2638     static {
2639         vectorNode(VECTOR_CAST_HF2F, "VectorCastHF2F", TYPE_FLOAT);
2640     }
2641 
2642     public static final String VECTOR_MASK_CAST = PREFIX + "VECTOR_MASK_CAST" + POSTFIX;
2643     static {
2644         beforeMatchingNameRegex(VECTOR_MASK_CAST, "VectorMaskCast");
2645     }
2646 
2647     public static final String VECTOR_REINTERPRET = PREFIX + "VECTOR_REINTERPRET" + POSTFIX;
2648     static {
2649         beforeMatchingNameRegex(VECTOR_REINTERPRET, "VectorReinterpret");
2650     }
2651 
2652     public static final String VECTOR_UCAST_B2S = VECTOR_PREFIX + "VECTOR_UCAST_B2S" + POSTFIX;
2653     static {
2654         vectorNode(VECTOR_UCAST_B2S, "VectorUCastB2X", TYPE_SHORT);
2655     }
2656 
2657     public static final String VECTOR_UCAST_B2I = VECTOR_PREFIX + "VECTOR_UCAST_B2I" + POSTFIX;
2658     static {
2659         vectorNode(VECTOR_UCAST_B2I, "VectorUCastB2X", TYPE_INT);
2660     }
2661 
2662     public static final String VECTOR_UCAST_B2L = VECTOR_PREFIX + "VECTOR_UCAST_B2L" + POSTFIX;
2663     static {
2664         vectorNode(VECTOR_UCAST_B2L, "VectorUCastB2X", TYPE_LONG);
2665     }
2666 
2667     public static final String VECTOR_UCAST_I2L = VECTOR_PREFIX + "VECTOR_UCAST_I2L" + POSTFIX;
2668     static {
2669         vectorNode(VECTOR_UCAST_I2L, "VectorUCastI2X", TYPE_LONG);
2670     }
2671 
2672     public static final String VECTOR_UCAST_S2I = VECTOR_PREFIX + "VECTOR_UCAST_S2I" + POSTFIX;
2673     static {
2674         vectorNode(VECTOR_UCAST_S2I, "VectorUCastS2X", TYPE_INT);
2675     }
2676 
2677     public static final String VECTOR_UCAST_S2L = VECTOR_PREFIX + "VECTOR_UCAST_S2L" + POSTFIX;
2678     static {
2679         vectorNode(VECTOR_UCAST_S2L, "VectorUCastS2X", TYPE_LONG);
2680     }
2681 
2682     public static final String VECTOR_TEST = PREFIX + "VECTOR_TEST" + POSTFIX;
2683     static {
2684         beforeMatchingNameRegex(VECTOR_TEST, "VectorTest");
2685     }
2686 
2687     public static final String VFABD = PREFIX + "VFABD" + POSTFIX;
2688     static {
2689         machOnlyNameRegex(VFABD, "vfabd");
2690     }
2691 
2692     public static final String VFABD_MASKED = PREFIX + "VFABD_MASKED" + POSTFIX;
2693     static {
2694         machOnlyNameRegex(VFABD_MASKED, "vfabd_masked");
2695     }
2696 
2697     public static final String VFMSB_MASKED = PREFIX + "VFMSB_MASKED" + POSTFIX;
2698     static {
2699         machOnlyNameRegex(VFMSB_MASKED, "vfmsb_masked");
2700     }
2701 
2702     public static final String RISCV_VFNMSUB_MASKED = PREFIX + "RISCV_VFNMSUB_MASKED" + POSTFIX;
2703     static {
2704         machOnlyNameRegex(RISCV_VFNMSUB_MASKED, "vfnmsub_masked");
2705     }
2706 
2707     public static final String VFNMAD_MASKED = PREFIX + "VFNMAD_MASKED" + POSTFIX;
2708     static {
2709         machOnlyNameRegex(VFNMAD_MASKED, "vfnmad_masked");
2710     }
2711 
2712     public static final String RISCV_VFNMADD_MASKED = PREFIX + "RISCV_VFNMADD_MASKED" + POSTFIX;
2713     static {
2714         machOnlyNameRegex(RISCV_VFNMADD_MASKED, "vfnmadd_masked");
2715     }
2716 
2717     public static final String VFNMSB_MASKED = PREFIX + "VFNMSB_MASKED" + POSTFIX;
2718     static {
2719         machOnlyNameRegex(VFNMSB_MASKED, "vfnmsb_masked");
2720     }
2721 
2722     public static final String RISCV_VFMSUB_MASKED = PREFIX + "RISCV_VFMSUB_MASKED" + POSTFIX;
2723     static {
2724         machOnlyNameRegex(RISCV_VFMSUB_MASKED, "vfmsub_masked");
2725     }
2726 
2727     public static final String VFMAD_MASKED = PREFIX + "VFMAD_MASKED" + POSTFIX;
2728     static {
2729         machOnlyNameRegex(VFMAD_MASKED, "vfmad_masked");
2730     }
2731 
2732     public static final String RISCV_VFMADD_MASKED = PREFIX + "RISCV_VFMADD_MASKED" + POSTFIX;
2733     static {
2734         machOnlyNameRegex(RISCV_VFMADD_MASKED, "vfmadd_masked");
2735     }
2736 
2737     public static final String VMASK_AND_NOT_L = PREFIX + "VMASK_AND_NOT_L" + POSTFIX;
2738     static {
2739         machOnlyNameRegex(VMASK_AND_NOT_L, "vmask_and_notL");
2740     }
2741 
2742     public static final String VMLA = PREFIX + "VMLA" + POSTFIX;
2743     static {
2744         machOnlyNameRegex(VMLA, "vmla");
2745     }
2746 
2747     public static final String VMLA_MASKED = PREFIX + "VMLA_MASKED" + POSTFIX;
2748     static {
2749         machOnlyNameRegex(VMLA_MASKED, "vmla_masked");
2750     }
2751 
2752     public static final String FMSUB = PREFIX + "FMSUB" + POSTFIX;
2753     static {
2754         machOnlyNameRegex(FMSUB, "msub(F|D)_reg_reg");
2755     }
2756 
2757     public static final String FNMADD = PREFIX + "FNMADD" + POSTFIX;
2758     static {
2759         machOnlyNameRegex(FNMADD, "mnadd(F|D)_reg_reg");
2760     }
2761 
2762     public static final String FNMSUB = PREFIX + "FNMSUB" + POSTFIX;
2763     static {
2764         machOnlyNameRegex(FNMSUB, "mnsub(F|D)_reg_reg");
2765     }
2766 
2767     public static final String FMA_F = PREFIX + "FMA_F" + POSTFIX;
2768     static {
2769         beforeMatchingNameRegex(FMA_F, "FmaF");
2770     }
2771 
2772     public static final String FMA_D = PREFIX + "FMA_D" + POSTFIX;
2773     static {
2774         beforeMatchingNameRegex(FMA_D, "FmaD");
2775     }
2776 
2777     public static final String VFMLA = PREFIX + "VFMLA" + POSTFIX;
2778     static {
2779         machOnlyNameRegex(VFMLA, "vfmla");
2780     }
2781 
2782     public static final String VFMLS = PREFIX + "VFMLS" + POSTFIX;
2783     static {
2784         machOnlyNameRegex(VFMLS, "vfmls");
2785     }
2786 
2787     public static final String VFNMLA = PREFIX + "VFNMLA" + POSTFIX;
2788     static {
2789         machOnlyNameRegex(VFNMLA, "vfnmla");
2790     }
2791 
2792     public static final String VMLS = PREFIX + "VMLS" + POSTFIX;
2793     static {
2794         machOnlyNameRegex(VMLS, "vmls");
2795     }
2796 
2797     public static final String VMLS_MASKED = PREFIX + "VMLS_MASKED" + POSTFIX;
2798     static {
2799         machOnlyNameRegex(VMLS_MASKED, "vmls_masked");
2800     }
2801 
2802     public static final String VMASK_CMP_ZERO_I_NEON = PREFIX + "VMASK_CMP_ZERO_I_NEON" + POSTFIX;
2803     static {
2804         machOnlyNameRegex(VMASK_CMP_ZERO_I_NEON, "vmaskcmp_zeroI_neon");
2805     }
2806 
2807     public static final String VMASK_CMP_ZERO_L_NEON = PREFIX + "VMASK_CMP_ZERO_L_NEON" + POSTFIX;
2808     static {
2809         machOnlyNameRegex(VMASK_CMP_ZERO_L_NEON, "vmaskcmp_zeroL_neon");
2810     }
2811 
2812     public static final String VMASK_CMP_ZERO_F_NEON = PREFIX + "VMASK_CMP_ZERO_F_NEON" + POSTFIX;
2813     static {
2814         machOnlyNameRegex(VMASK_CMP_ZERO_F_NEON, "vmaskcmp_zeroF_neon");
2815     }
2816 
2817     public static final String VMASK_CMP_ZERO_D_NEON = PREFIX + "VMASK_CMP_ZERO_D_NEON" + POSTFIX;
2818     static {
2819         machOnlyNameRegex(VMASK_CMP_ZERO_D_NEON, "vmaskcmp_zeroD_neon");
2820     }
2821 
2822     public static final String VMASK_CMP_IMM_I_SVE = PREFIX + "VMASK_CMP_IMM_I_SVE" + POSTFIX;
2823     static {
2824         machOnlyNameRegex(VMASK_CMP_IMM_I_SVE, "vmaskcmp_immI_sve");
2825     }
2826 
2827     public static final String VMASK_CMPU_IMM_I_SVE = PREFIX + "VMASK_CMPU_IMM_I_SVE" + POSTFIX;
2828     static {
2829         machOnlyNameRegex(VMASK_CMPU_IMM_I_SVE, "vmaskcmpU_immI_sve");
2830     }
2831 
2832     public static final String VMASK_CMP_IMM_L_SVE = PREFIX + "VMASK_CMP_IMM_L_SVE" + POSTFIX;
2833     static {
2834         machOnlyNameRegex(VMASK_CMP_IMM_L_SVE, "vmaskcmp_immL_sve");
2835     }
2836 
2837     public static final String VMASK_CMPU_IMM_L_SVE = PREFIX + "VMASK_CMPU_IMM_L_SVE" + POSTFIX;
2838     static {
2839         machOnlyNameRegex(VMASK_CMPU_IMM_L_SVE, "vmaskcmpU_immL_sve");
2840     }
2841 
2842     public static final String VNOT_I_MASKED = PREFIX + "VNOT_I_MASKED" + POSTFIX;
2843     static {
2844         machOnlyNameRegex(VNOT_I_MASKED, "vnotI_masked");
2845     }
2846 
2847     public static final String VNOT_L_MASKED = PREFIX + "VNOT_L_MASKED" + POSTFIX;
2848     static {
2849         machOnlyNameRegex(VNOT_L_MASKED, "vnotL_masked");
2850     }
2851 
2852     public static final String VSTOREMASK_TRUECOUNT = PREFIX + "VSTOREMASK_TRUECOUNT" + POSTFIX;
2853     static {
2854         machOnlyNameRegex(VSTOREMASK_TRUECOUNT, "vstoremask_truecount_neon");
2855     }
2856 
2857     public static final String X86_SCONV_D2I = PREFIX + "X86_SCONV_D2I" + POSTFIX;
2858     static {
2859         machOnlyNameRegex(X86_SCONV_D2I, "convD2I_reg_reg");
2860     }
2861 
2862     public static final String X86_SCONV_D2L = PREFIX + "X86_SCONV_D2L" + POSTFIX;
2863     static {
2864         machOnlyNameRegex(X86_SCONV_D2L, "convD2L_reg_reg");
2865     }
2866 
2867     public static final String X86_SCONV_F2I = PREFIX + "X86_SCONV_F2I" + POSTFIX;
2868     static {
2869         machOnlyNameRegex(X86_SCONV_F2I, "convF2I_reg_reg");
2870     }
2871 
2872     public static final String X86_SCONV_F2L = PREFIX + "X86_SCONV_F2L" + POSTFIX;
2873     static {
2874         machOnlyNameRegex(X86_SCONV_F2L, "convF2L_reg_reg");
2875     }
2876 
2877     public static final String X86_SCONV_D2I_AVX10_2 = PREFIX + "X86_SCONV_D2I_AVX10_2" + POSTFIX;
2878     static {
2879         machOnlyNameRegex(X86_SCONV_D2I_AVX10_2, "convD2I_(reg_reg|reg_mem)_avx10_2");
2880     }
2881 
2882     public static final String X86_SCONV_D2L_AVX10_2 = PREFIX + "X86_SCONV_D2L_AVX10_2" + POSTFIX;
2883     static {
2884         machOnlyNameRegex(X86_SCONV_D2L_AVX10_2, "convD2L_(reg_reg|reg_mem)_avx10_2");
2885     }
2886 
2887     public static final String X86_SCONV_F2I_AVX10_2 = PREFIX + "X86_SCONV_F2I_AVX10_2" + POSTFIX;
2888     static {
2889         machOnlyNameRegex(X86_SCONV_F2I_AVX10_2, "convF2I_(reg_reg|reg_mem)_avx10_2");
2890     }
2891 
2892     public static final String X86_SCONV_F2L_AVX10_2 = PREFIX + "X86_SCONV_F2L_AVX10_2" + POSTFIX;
2893     static {
2894         machOnlyNameRegex(X86_SCONV_F2L_AVX10_2, "convF2L_(reg_reg|reg_mem)_avx10_2");
2895     }
2896 
2897     public static final String X86_VCAST_F2X = PREFIX + "X86_VCAST_F2X" + POSTFIX;
2898     static {
2899         machOnlyNameRegex(X86_VCAST_F2X, "castFtoX_reg_(av|eve)x");
2900     }
2901 
2902     public static final String X86_VCAST_D2X = PREFIX + "X86_VCAST_D2X" + POSTFIX;
2903     static {
2904         machOnlyNameRegex(X86_VCAST_D2X, "castDtoX_reg_(av|eve)x");
2905     }
2906 
2907     public static final String X86_VCAST_F2X_AVX10_2 = PREFIX + "X86_VCAST_F2X_AVX10_2" + POSTFIX;
2908     static {
2909         machOnlyNameRegex(X86_VCAST_F2X_AVX10_2, "castFtoX_(reg|mem)_avx10_2");
2910     }
2911 
2912     public static final String X86_VCAST_D2X_AVX10_2 = PREFIX + "X86_VCAST_D2X_AVX10_2" + POSTFIX;
2913     static {
2914         machOnlyNameRegex(X86_VCAST_D2X_AVX10_2, "castDtoX_(reg|mem)_avx10_2");
2915     }
2916 
2917     public static final String XOR = PREFIX + "XOR" + POSTFIX;
2918     static {
2919         beforeMatchingNameRegex(XOR, "Xor(I|L)");
2920     }
2921 
2922     public static final String XOR_I = PREFIX + "XOR_I" + POSTFIX;
2923     static {
2924         beforeMatchingNameRegex(XOR_I, "XorI");
2925     }
2926 
2927     public static final String XOR_L = PREFIX + "XOR_L" + POSTFIX;
2928     static {
2929         beforeMatchingNameRegex(XOR_L, "XorL");
2930     }
2931 
2932     public static final String XOR_VB = VECTOR_PREFIX + "XOR_VB" + POSTFIX;
2933     static {
2934         vectorNode(XOR_VB, "XorV", TYPE_BYTE);
2935     }
2936 
2937     public static final String XOR_VS = VECTOR_PREFIX + "XOR_VS" + POSTFIX;
2938     static {
2939         vectorNode(XOR_VS, "XorV", TYPE_SHORT);
2940     }
2941 
2942     public static final String XOR_VI = VECTOR_PREFIX + "XOR_VI" + POSTFIX;
2943     static {
2944         vectorNode(XOR_VI, "XorV", TYPE_INT);
2945     }
2946 
2947     public static final String XOR_VL = VECTOR_PREFIX + "XOR_VL" + POSTFIX;
2948     static {
2949         vectorNode(XOR_VL, "XorV", TYPE_LONG);
2950     }
2951 
2952     public static final String XOR_V = PREFIX + "XOR_V" + POSTFIX;
2953     static {
2954         beforeMatchingNameRegex(XOR_V, "XorV");
2955     }
2956 
2957     public static final String XOR_V_MASK = PREFIX + "XOR_V_MASK" + POSTFIX;
2958     static {
2959         beforeMatchingNameRegex(XOR_V_MASK, "XorVMask");
2960     }
2961 
2962     public static final String XOR_REDUCTION_V = PREFIX + "XOR_REDUCTION_V" + POSTFIX;
2963     static {
2964         superWordNodes(XOR_REDUCTION_V, "XorReductionV");
2965     }
2966 
2967     public static final String XOR3_NEON = PREFIX + "XOR3_NEON" + POSTFIX;
2968     static {
2969         machOnlyNameRegex(XOR3_NEON, "veor3_neon");
2970     }
2971 
2972     public static final String XOR3_SVE = PREFIX + "XOR3_SVE" + POSTFIX;
2973     static {
2974         machOnlyNameRegex(XOR3_SVE, "veor3_sve");
2975     }
2976 
2977     public static final String COMPRESS_BITS_VI = VECTOR_PREFIX + "COMPRESS_BITS_VI" + POSTFIX;
2978     static {
2979         vectorNode(COMPRESS_BITS_VI, "CompressBitsV", TYPE_INT);
2980     }
2981 
2982     public static final String COMPRESS_BITS_VL = VECTOR_PREFIX + "COMPRESS_BITS_VL" + POSTFIX;
2983     static {
2984         vectorNode(COMPRESS_BITS_VL, "CompressBitsV", TYPE_LONG);
2985     }
2986 
2987     public static final String EXPAND_BITS_VI = VECTOR_PREFIX + "EXPAND_BITS_VI" + POSTFIX;
2988     static {
2989         vectorNode(EXPAND_BITS_VI, "ExpandBitsV", TYPE_INT);
2990     }
2991 
2992     public static final String EXPAND_BITS_VL = VECTOR_PREFIX + "EXPAND_BITS_VL" + POSTFIX;
2993     static {
2994         vectorNode(EXPAND_BITS_VL, "ExpandBitsV", TYPE_LONG);
2995     }
2996 
2997     public static final String COMPRESS_VB = VECTOR_PREFIX + "COMPRESS_VB" + POSTFIX;
2998     static {
2999         vectorNode(COMPRESS_VB, "CompressV", TYPE_BYTE);
3000     }
3001 
3002     public static final String COMPRESS_VS = VECTOR_PREFIX + "COMPRESS_VS" + POSTFIX;
3003     static {
3004         vectorNode(COMPRESS_VS, "CompressV", TYPE_SHORT);
3005     }
3006 
3007     public static final String COMPRESS_VI = VECTOR_PREFIX + "COMPRESS_VI" + POSTFIX;
3008     static {
3009         vectorNode(COMPRESS_VI, "CompressV", TYPE_INT);
3010     }
3011 
3012     public static final String COMPRESS_VL = VECTOR_PREFIX + "COMPRESS_VL" + POSTFIX;
3013     static {
3014         vectorNode(COMPRESS_VL, "CompressV", TYPE_LONG);
3015     }
3016 
3017     public static final String COMPRESS_VF = VECTOR_PREFIX + "COMPRESS_VF" + POSTFIX;
3018     static {
3019         vectorNode(COMPRESS_VF, "CompressV", TYPE_FLOAT);
3020     }
3021 
3022     public static final String COMPRESS_VD = VECTOR_PREFIX + "COMPRESS_VD" + POSTFIX;
3023     static {
3024         vectorNode(COMPRESS_VD, "CompressV", TYPE_DOUBLE);
3025     }
3026 
3027     public static final String EXPAND_VB = VECTOR_PREFIX + "EXPAND_VB" + POSTFIX;
3028     static {
3029         vectorNode(EXPAND_VB, "ExpandV", TYPE_BYTE);
3030     }
3031 
3032     public static final String EXPAND_VS = VECTOR_PREFIX + "EXPAND_VS" + POSTFIX;
3033     static {
3034         vectorNode(EXPAND_VS, "ExpandV", TYPE_SHORT);
3035     }
3036 
3037     public static final String EXPAND_VI = VECTOR_PREFIX + "EXPAND_VI" + POSTFIX;
3038     static {
3039         vectorNode(EXPAND_VI, "ExpandV", TYPE_INT);
3040     }
3041 
3042     public static final String EXPAND_VL = VECTOR_PREFIX + "EXPAND_VL" + POSTFIX;
3043     static {
3044         vectorNode(EXPAND_VL, "ExpandV", TYPE_LONG);
3045     }
3046 
3047     public static final String EXPAND_VF = VECTOR_PREFIX + "EXPAND_VF" + POSTFIX;
3048     static {
3049         vectorNode(EXPAND_VF, "ExpandV", TYPE_FLOAT);
3050     }
3051 
3052     public static final String EXPAND_VD = VECTOR_PREFIX + "EXPAND_VD" + POSTFIX;
3053     static {
3054         vectorNode(EXPAND_VD, "ExpandV", TYPE_DOUBLE);
3055     }
3056 
3057     public static final String Z_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX;
3058     static {
3059         String regex = START + "zLoadP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
3060         machOnly(Z_LOAD_P_WITH_BARRIER_FLAG, regex);
3061     }
3062 
3063     public static final String Z_STORE_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_STORE_P_WITH_BARRIER_FLAG" + POSTFIX;
3064     static {
3065         String regex = START + "zStoreP\\S*" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
3066         machOnly(Z_STORE_P_WITH_BARRIER_FLAG, regex);
3067     }
3068 
3069     public static final String Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG" + POSTFIX;
3070     static {
3071         String regex = START + "zCompareAndSwapP" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
3072         machOnly(Z_COMPARE_AND_SWAP_P_WITH_BARRIER_FLAG, regex);
3073     }
3074 
3075     public static final String Z_GET_AND_SET_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_GET_AND_SET_P_WITH_BARRIER_FLAG" + POSTFIX;
3076     static {
3077         String regex = START + "(zXChgP)|(zGetAndSetP\\S*)" + MID + "barrier\\(\\s*" + IS_REPLACED + "\\s*\\)" + END;
3078         machOnly(Z_GET_AND_SET_P_WITH_BARRIER_FLAG, regex);
3079     }
3080 
3081     public static final String X86_LOCK_ADDB_REG = PREFIX + "X86_LOCK_ADDB_REG" + POSTFIX;
3082     static {
3083         machOnlyNameRegex(X86_LOCK_ADDB_REG, "xaddB_reg_no_res");
3084     }
3085 
3086     public static final String X86_LOCK_ADDB_IMM = PREFIX + "X86_LOCK_ADDB_IMM" + POSTFIX;
3087     static {
3088         machOnlyNameRegex(X86_LOCK_ADDB_IMM, "xaddB_imm_no_res");
3089     }
3090 
3091     public static final String X86_LOCK_XADDB = PREFIX + "X86_LOCK_XADDB" + POSTFIX;
3092     static {
3093         machOnlyNameRegex(X86_LOCK_XADDB, "xaddB");
3094     }
3095 
3096     public static final String X86_LOCK_ADDS_REG = PREFIX + "X86_LOCK_ADDS_REG" + POSTFIX;
3097     static {
3098         machOnlyNameRegex(X86_LOCK_ADDS_REG, "xaddS_reg_no_res");
3099     }
3100 
3101     public static final String X86_LOCK_ADDS_IMM = PREFIX + "X86_LOCK_ADDS_IMM" + POSTFIX;
3102     static {
3103         machOnlyNameRegex(X86_LOCK_ADDS_IMM, "xaddS_imm_no_res");
3104     }
3105 
3106     public static final String X86_LOCK_XADDS = PREFIX + "X86_LOCK_XADDS" + POSTFIX;
3107     static {
3108         machOnlyNameRegex(X86_LOCK_XADDS, "xaddS");
3109     }
3110 
3111     public static final String X86_LOCK_ADDI_REG = PREFIX + "X86_LOCK_ADDI_REG" + POSTFIX;
3112     static {
3113         machOnlyNameRegex(X86_LOCK_ADDI_REG, "xaddI_reg_no_res");
3114     }
3115 
3116     public static final String X86_LOCK_ADDI_IMM = PREFIX + "X86_LOCK_ADDI_IMM" + POSTFIX;
3117     static {
3118         machOnlyNameRegex(X86_LOCK_ADDI_IMM, "xaddI_imm_no_res");
3119     }
3120 
3121     public static final String X86_LOCK_XADDI = PREFIX + "X86_LOCK_XADDI" + POSTFIX;
3122     static {
3123         machOnlyNameRegex(X86_LOCK_XADDI, "xaddI");
3124     }
3125 
3126     public static final String X86_LOCK_ADDL_REG = PREFIX + "X86_LOCK_ADDL_REG" + POSTFIX;
3127     static {
3128         machOnlyNameRegex(X86_LOCK_ADDL_REG, "xaddL_reg_no_res");
3129     }
3130 
3131     public static final String X86_LOCK_ADDL_IMM = PREFIX + "X86_LOCK_ADDL_IMM" + POSTFIX;
3132     static {
3133         machOnlyNameRegex(X86_LOCK_ADDL_IMM, "xaddL_imm_no_res");
3134     }
3135 
3136     public static final String X86_LOCK_XADDL = PREFIX + "X86_LOCK_XADDL" + POSTFIX;
3137     static {
3138         machOnlyNameRegex(X86_LOCK_XADDL, "xaddL");
3139     }
3140 
3141     public static final String X86_TESTI_REG = PREFIX + "X86_TESTI_REG" + POSTFIX;
3142     static {
3143         machOnlyNameRegex(X86_TESTI_REG, "testI_reg");
3144     }
3145 
3146     public static final String X86_TESTL_REG = PREFIX + "X86_TESTL_REG" + POSTFIX;
3147     static {
3148         machOnlyNameRegex(X86_TESTL_REG, "testL_reg");
3149     }
3150 
3151     public static final String X86_CMOVEL_IMM01 = PREFIX + "X86_CMOVEL_IMM01" + POSTFIX;
3152     static {
3153         machOnlyNameRegex(X86_CMOVEL_IMM01, "cmovL_imm_01");
3154     }
3155 
3156     public static final String X86_CMOVEL_IMM01U = PREFIX + "X86_CMOVEL_IMM01U" + POSTFIX;
3157     static {
3158         machOnlyNameRegex(X86_CMOVEL_IMM01U, "cmovL_imm_01U");
3159     }
3160 
3161     public static final String X86_CMOVEL_IMM01UCF = PREFIX + "X86_CMOVEL_IMM01UCF" + POSTFIX;
3162     static {
3163         machOnlyNameRegex(X86_CMOVEL_IMM01UCF, "cmovL_imm_01UCF");
3164     }
3165 
3166     public static final String X86_CMOVEL_IMM01UCFE = PREFIX + "X86_CMOVEL_IMM01UCFE" + POSTFIX;
3167     static {
3168         machOnlyNameRegex(X86_CMOVEL_IMM01UCFE, "cmovL_imm_01UCFE");
3169     }
3170 
3171     public static final String MOD_F = PREFIX + "MOD_F" + POSTFIX;
3172     static {
3173         String regex = START + "ModF" + MID + END;
3174         macroNodes(MOD_F, regex);
3175     }
3176 
3177     public static final String MOD_D = PREFIX + "MOD_D" + POSTFIX;
3178     static {
3179         String regex = START + "ModD" + MID + END;
3180         macroNodes(MOD_D, regex);
3181     }
3182 
3183     public static final String BLACKHOLE = PREFIX + "BLACKHOLE" + POSTFIX;
3184     static {
3185         fromBeforeRemoveUselessToFinalCode(BLACKHOLE, "Blackhole");
3186     }
3187 
3188     public static final String SELECT_FROM_TWO_VECTOR_VB = VECTOR_PREFIX + "SELECT_FROM_TWO_VECTOR_VB" + POSTFIX;
3189     static {
3190         vectorNode(SELECT_FROM_TWO_VECTOR_VB, "SelectFromTwoVector", TYPE_BYTE);
3191     }
3192 
3193     public static final String SELECT_FROM_TWO_VECTOR_VS = VECTOR_PREFIX + "SELECT_FROM_TWO_VECTOR_VS" + POSTFIX;
3194     static {
3195         vectorNode(SELECT_FROM_TWO_VECTOR_VS, "SelectFromTwoVector", TYPE_SHORT);
3196     }
3197 
3198     public static final String SELECT_FROM_TWO_VECTOR_VI = VECTOR_PREFIX + "SELECT_FROM_TWO_VECTOR_VI" + POSTFIX;
3199     static {
3200         vectorNode(SELECT_FROM_TWO_VECTOR_VI, "SelectFromTwoVector", TYPE_INT);
3201     }
3202 
3203     public static final String SELECT_FROM_TWO_VECTOR_VF = VECTOR_PREFIX + "SELECT_FROM_TWO_VECTOR_VF" + POSTFIX;
3204     static {
3205         vectorNode(SELECT_FROM_TWO_VECTOR_VF, "SelectFromTwoVector", TYPE_FLOAT);
3206     }
3207 
3208     public static final String SELECT_FROM_TWO_VECTOR_VD = VECTOR_PREFIX + "SELECT_FROM_TWO_VECTOR_VD" + POSTFIX;
3209     static {
3210         vectorNode(SELECT_FROM_TWO_VECTOR_VD, "SelectFromTwoVector", TYPE_DOUBLE);
3211     }
3212 
3213     public static final String SELECT_FROM_TWO_VECTOR_VL = VECTOR_PREFIX + "SELECT_FROM_TWO_VECTOR_VL" + POSTFIX;
3214     static {
3215         vectorNode(SELECT_FROM_TWO_VECTOR_VL, "SelectFromTwoVector", TYPE_LONG);
3216     }
3217 
3218     public static final String REPLICATE_HF = PREFIX + "REPLICATE_HF" + POSTFIX;
3219     static {
3220         machOnlyNameRegex(REPLICATE_HF, "replicateHF");
3221     }
3222 
3223     public static final String REPLICATE_HF_IMM8 = PREFIX + "REPLICATE_HF_IMM8" + POSTFIX;
3224     static {
3225         machOnlyNameRegex(REPLICATE_HF_IMM8, "replicateHF_imm8_gt128b");
3226     }
3227 
3228     public static final String OPAQUE_CONSTANT_BOOL = PREFIX + "OPAQUE_CONSTANT_BOOL" + POSTFIX;
3229     static {
3230         beforeMatchingNameRegex(OPAQUE_CONSTANT_BOOL, "OpaqueConstantBool");
3231     }
3232 
3233     /*
3234      * Utility methods to set up IR_NODE_MAPPINGS.
3235      */
3236 
3237     /**
3238      * Apply {@code regex} on all machine independent ideal graph phases up to and including
3239      * {@link CompilePhase#BEFORE_MATCHING}.
3240      */
3241     public static void beforeMatching(String irNodePlaceholder, String regex) {
3242         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
3243     }
3244 
3245     /**
3246      * Apply {@code irNodeRegex} as regex for the IR node name on all machine independent ideal graph phases up to and
3247      * including {@link CompilePhase#BEFORE_MATCHING}.
3248      */
3249     private static void beforeMatchingNameRegex(String irNodePlaceholder, String irNodeRegex) {
3250         String regex = START + irNodeRegex + MID + END;
3251         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
3252     }
3253 
3254     /**
3255      * Apply {@code irNodeRegex} as regex for the IR vector node name on all machine independent ideal graph phases up to and
3256      * including {@link CompilePhase#BEFORE_MATCHING}. Since this is a vector node, we can also check the vector element
3257      * type {@code typeString} and the vector size (number of elements), {@see VECTOR_SIZE}.
3258      */
3259     private static void vectorNode(String irNodePlaceholder, String irNodeRegex, String typeString) {
3260         TestFramework.check(isVectorIRNode(irNodePlaceholder), "vectorNode: failed prefix check for irNodePlaceholder "
3261                                                                + irNodePlaceholder + " -> did you use VECTOR_PREFIX?");
3262         // IS_REPLACED is later replaced with the specific type and size of the vector.
3263         String regex = START + irNodeRegex + MID  + IS_REPLACED + END;
3264         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
3265         VECTOR_NODE_TYPE.put(irNodePlaceholder, typeString);
3266     }
3267 
3268     /**
3269      * Apply {@code regex} on all ideal graph phases up to and including {@link CompilePhase#BEFORE_MACRO_EXPANSION}.
3270      */
3271     private static void macroNodes(String irNodePlaceholder, String regex) {
3272         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.BEFORE_MACRO_EXPANSION, regex,
3273                                                                           CompilePhase.BEFORE_STRINGOPTS,
3274                                                                           CompilePhase.BEFORE_MACRO_EXPANSION));
3275     }
3276 
3277     private static void callOfNodes(String irNodePlaceholder, String callRegex, String calleeRegex) {
3278         String regex = START + callRegex + MID + calleeRegex + END;
3279         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex));
3280     }
3281 
3282     /**
3283      * Apply {@code regex} on all machine dependant ideal graph phases (i.e. on the mach graph) starting from
3284      * {@link CompilePhase#MATCHING}.
3285      */
3286     public static void optoOnly(String irNodePlaceholder, String regex) {
3287         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.OPTO_ASSEMBLY, regex));
3288     }
3289 
3290     private static void machOnly(String irNodePlaceholder, String regex) {
3291         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.MACH, regex));
3292     }
3293 
3294     private static void machOnlyNameRegex(String irNodePlaceholder, String irNodeRegex) {
3295         String regex = START + irNodeRegex + MID + END;
3296         IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.MACH, regex));
3297     }
3298 
3299     /**
3300      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#AFTER_CLOOPS}.
3301      */
3302     private static void fromAfterCountedLoops(String irNodePlaceholder, String regex) {
3303         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
3304                                                                           CompilePhase.AFTER_CLOOPS,
3305                                                                           CompilePhase.FINAL_CODE));
3306     }
3307 
3308     /**
3309      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS}.
3310      */
3311     private static void fromBeforeCountedLoops(String irNodePlaceholder, String regex) {
3312         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
3313                                                                           CompilePhase.BEFORE_CLOOPS,
3314                                                                           CompilePhase.FINAL_CODE));
3315     }
3316 
3317     /**
3318      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS} up to and
3319      * including {@link CompilePhase#BEFORE_MATCHING}
3320      */
3321     private static void fromMacroToBeforeMatching(String irNodePlaceholder, String regex) {
3322         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
3323                                                                           CompilePhase.AFTER_MACRO_EXPANSION,
3324                                                                           CompilePhase.BEFORE_MATCHING));
3325     }
3326 
3327     /**
3328      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_CLOOPS} up to and
3329      * including {@link CompilePhase#BEFORE_MATCHING}
3330      */
3331     private static void afterBarrierExpansionToBeforeMatching(String irNodePlaceholder, String regex) {
3332         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
3333                                                                           CompilePhase.OPTIMIZE_FINISHED,
3334                                                                           CompilePhase.BEFORE_MATCHING));
3335     }
3336 
3337     /**
3338      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#BEFORE_LOOP_OPTS}
3339      * up to and including {@link CompilePhase#AFTER_LOOP_OPTS}.
3340      */
3341     private static void duringLoopOpts(String irNodePlaceholder, String regex) {
3342         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.AFTER_LOOP_OPTS, regex,
3343                                                                           CompilePhase.BEFORE_LOOP_OPTS,
3344                                                                           CompilePhase.AFTER_LOOP_OPTS));
3345     }
3346 
3347     private static void trapNodes(String irNodePlaceholder, String trapReason) {
3348         String regex = START + "CallStaticJava" + MID + "uncommon_trap.*" + trapReason + END;
3349         beforeMatching(irNodePlaceholder, regex);
3350     }
3351 
3352     private static void parsePredicateNodes(String irNodePlaceholder, String label) {
3353         String regex = START + "ParsePredicate" + MID + "#" + label + " " + END;
3354         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.AFTER_PARSING, regex,
3355                                                                           CompilePhase.AFTER_PARSING,
3356                                                                           CompilePhase.AFTER_LOOP_OPTS));
3357     }
3358 
3359     // Typename in load/store have the structure:
3360     // @ptrtype:fully/qualified/package/name/to/TheClass:ptrlattice+12
3361     // with ptrtype being the kind of the type such as instptr, aryptr, etc, and ptrlattice being
3362     // the kind of the value such as BotPTR, NotNull, etc.
3363     // And variation:
3364     // - after ptrtype, we can have "stable:" or other labels, with optional space after ':'
3365     // - the class can actually be a nested class, with $ separator (and it must be ok to give only the deepest one
3366     // - after the class name, we can have a comma-separated list of implemented interfaces enclosed in parentheses
3367     // Worst case, it can be something like:
3368     // @bla: bli:a/b/c$d$e (f/g,h/i/j):NotNull+24
3369 
3370     // @ matches the start character of the pattern
3371     // (\w+: ?)+ tries to match the pattern 'ptrtype:' or 'stable:' with optional trailing whitespaces
3372     // [\\w/\\$] tries to match the pattern such as 'a/b/', 'a/b', or '/b' but also nested class such as '$c' or '$c$d'
3373     // \b asserts that the next character is a word character
3374     private static final String LOAD_STORE_PREFIX = "@(\\w+: ?)+[\\w/\\$]*\\b";
3375     // ( \([^\)]+\))? tries to match the pattern ' (f/g,h/i/j)'
3376     // :\w+ tries to match the pattern ':NotNull'
3377     // .* tries to match the remaining of the pattern
3378     private static final String LOAD_STORE_SUFFIX = "( \\([^\\)]+\\))?:\\w+.*";
3379 
3380     private static void loadOfNodes(String irNodePlaceholder, String irNodeRegex, String loadee) {
3381         String regex = START + irNodeRegex + MID + LOAD_STORE_PREFIX + loadee + LOAD_STORE_SUFFIX + END;
3382         beforeMatching(irNodePlaceholder, regex);
3383     }
3384 
3385     private static void storeOfNodes(String irNodePlaceholder, String irNodeRegex, String storee) {
3386         String regex = START + irNodeRegex + MID + LOAD_STORE_PREFIX + storee + LOAD_STORE_SUFFIX + END;
3387         beforeMatching(irNodePlaceholder, regex);
3388     }
3389 
3390     private static void safepointScalarobjectOfNodes(String irNodePlaceholder, String irNodeRegex) {
3391         String regex = START + irNodeRegex + MID + ".*" + IS_REPLACED + ".*" + END;
3392         beforeMatching(irNodePlaceholder, regex);
3393     }
3394 
3395     private static void fromBeforeRemoveUselessToFinalCode(String irNodePlaceholder, String irNodeRegex) {
3396         String regex = START + irNodeRegex + MID + END;
3397         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
3398                 CompilePhase.BEFORE_REMOVEUSELESS,
3399                 CompilePhase.FINAL_CODE));
3400     }
3401 
3402     /**
3403      * Apply {@code regex} on all ideal graph phases starting from {@link CompilePhase#PHASEIDEALLOOP1} which is the
3404      * first phase that could contain vector nodes from super word.
3405      */
3406     private static void superWordNodes(String irNodePlaceholder, String irNodeRegex) {
3407         String regex = START + irNodeRegex + MID + END;
3408         IR_NODE_MAPPINGS.put(irNodePlaceholder, new SinglePhaseRangeEntry(CompilePhase.PRINT_IDEAL, regex,
3409                                                                           CompilePhase.PHASEIDEALLOOP1,
3410                                                                           CompilePhase.BEFORE_MATCHING));
3411     }
3412 
3413 
3414     /*
3415      * Methods used internally by the IR framework.
3416      */
3417 
3418     /**
3419      * Is {@code irNodeString} an IR node placeholder string?
3420      */
3421     public static boolean isIRNode(String irNodeString) {
3422         return irNodeString.startsWith(PREFIX);
3423     }
3424 
3425     /**
3426      * Is {@code irCompositeNodeString} an IR composite node placeholder string?
3427      */
3428     public static boolean isCompositeIRNode(String irCompositeNodeString) {
3429         return irCompositeNodeString.startsWith(COMPOSITE_PREFIX);
3430     }
3431 
3432     /**
3433      * Is {@code irVectorNodeString} an IR vector node placeholder string?
3434      */
3435     public static boolean isVectorIRNode(String irVectorNodeString) {
3436         return irVectorNodeString.startsWith(VECTOR_PREFIX);
3437     }
3438 
3439     /**
3440      * Is {@code irVectorSizeString} a vector size string?
3441      */
3442     public static boolean isVectorSize(String irVectorSizeString) {
3443         return irVectorSizeString.startsWith(VECTOR_SIZE);
3444     }
3445 
3446     /**
3447      * Parse {@code sizeString} and generate a regex pattern to match for the size in the IR dump.
3448      */
3449     public static String parseVectorNodeSize(String sizeString, String typeString, VMInfo vmInfo) {
3450         if (sizeString.equals(VECTOR_SIZE_TAG_ANY)) {
3451             return "\\\\d+"; // match with any number
3452         }
3453         // Try to parse any tags, convert to comma separated list of ints
3454         sizeString = parseVectorNodeSizeTag(sizeString, typeString, vmInfo);
3455         // Parse comma separated list of numbers
3456         String[] sizes = sizeString.split(",");
3457         String regex = "";
3458         for (int i = 0; i < sizes.length; i++) {
3459             int size = 0;
3460             try {
3461                 size = Integer.parseInt(sizes[i]);
3462             } catch (NumberFormatException e) {
3463                 throw new TestFormatException("Vector node has invalid size \"" + sizes[i] + "\", in \"" + sizeString + "\"");
3464             }
3465             TestFormat.checkNoReport(size > 1, "Vector node size must be 2 or larger, but got \"" + sizes[i] + "\", in \"" + sizeString + "\"");
3466             regex += ((i > 0) ? "|" : "") + size;
3467         }
3468         if (sizes.length > 1) {
3469            regex = "(" + regex + ")";
3470         }
3471         return regex;
3472     }
3473 
3474     /**
3475      * If {@code sizeTagString} is a size tag, return the list of accepted sizes, else return sizeTagString.
3476      */
3477     public static String parseVectorNodeSizeTag(String sizeTagString, String typeString, VMInfo vmInfo) {
3478         // Parse out "min(a,b,c,...)"
3479         if (sizeTagString.startsWith("min(") && sizeTagString.endsWith(")")) {
3480             return parseVectorNodeSizeTagMin(sizeTagString, typeString, vmInfo);
3481         }
3482 
3483         // Parse individual tags
3484         return switch (sizeTagString) {
3485             case VECTOR_SIZE_TAG_MAX -> String.valueOf(getMaxElementsForType(typeString, vmInfo));
3486             case "max_byte"          -> String.valueOf(getMaxElementsForType(TYPE_BYTE, vmInfo));
3487             case "max_char"          -> String.valueOf(getMaxElementsForType(TYPE_CHAR, vmInfo));
3488             case "max_short"         -> String.valueOf(getMaxElementsForType(TYPE_SHORT, vmInfo));
3489             case "max_int"           -> String.valueOf(getMaxElementsForType(TYPE_INT, vmInfo));
3490             case "max_long"          -> String.valueOf(getMaxElementsForType(TYPE_LONG, vmInfo));
3491             case "max_float"         -> String.valueOf(getMaxElementsForType(TYPE_FLOAT, vmInfo));
3492             case "max_double"        -> String.valueOf(getMaxElementsForType(TYPE_DOUBLE, vmInfo));
3493             case "LoopMaxUnroll"     -> String.valueOf(vmInfo.getLongValue("LoopMaxUnroll"));
3494             default                  -> sizeTagString;
3495         };
3496     }
3497 
3498     /**
3499      * Parse {@code sizeTagString}, which must be a min-clause.
3500      */
3501     public static String parseVectorNodeSizeTagMin(String sizeTagString, String typeString, VMInfo vmInfo) {
3502         String[] tags = sizeTagString.substring(4, sizeTagString.length() - 1).split(",");
3503         TestFormat.checkNoReport(tags.length > 1, "Vector node size \"min(...)\" must have at least 2 comma separated arguments, got \"" + sizeTagString + "\"");
3504         int minVal = 1024;
3505         for (int i = 0; i < tags.length; i++) {
3506             String tag = parseVectorNodeSizeTag(tags[i].trim(), typeString, vmInfo);
3507             int tag_val = 0;
3508             try {
3509                 tag_val = Integer.parseInt(tag);
3510             } catch (NumberFormatException e) {
3511                 throw new TestFormatException("Vector node has invalid size in \"min(...)\", argument " + i + ", \"" + tag + "\", in \"" + sizeTagString + "\"");
3512             }
3513             minVal = Math.min(minVal, tag_val);
3514         }
3515         return String.valueOf(minVal);
3516     }
3517 
3518     /**
3519      * Return maximal number of elements that can fit in a vector of the specified type.
3520      */
3521     public static long getMaxElementsForType(String typeString, VMInfo vmInfo) {
3522         long maxVectorSize = vmInfo.getLongValue("MaxVectorSize");
3523         TestFormat.checkNoReport(maxVectorSize > 0, "VMInfo: MaxVectorSize is not larger than zero");
3524         long maxBytes = maxVectorSize;
3525 
3526         if (Platform.isX64() || Platform.isX86()) {
3527             maxBytes = Math.min(maxBytes, getMaxElementsForTypeOnX86(typeString, vmInfo));
3528         }
3529 
3530         // compute elements per vector: vector bytes divided by bytes per element
3531         int bytes = getTypeSizeInBytes(typeString);
3532         return maxBytes / bytes;
3533     }
3534 
3535     /**
3536      * Return maximal number of elements that can fit in a vector of the specified type, on x86 / x64.
3537      */
3538     public static long getMaxElementsForTypeOnX86(String typeString, VMInfo vmInfo) {
3539         // restrict maxBytes for specific features, see Matcher::vector_width_in_bytes in x86.ad:
3540         boolean avx1 = vmInfo.hasCPUFeature("avx");
3541         boolean avx2 = vmInfo.hasCPUFeature("avx2");
3542         boolean avx512 = vmInfo.hasCPUFeature("avx512f");
3543         boolean avx512bw = vmInfo.hasCPUFeature("avx512bw");
3544         long maxBytes;
3545         if (avx512) {
3546             maxBytes = 64;
3547         } else if (avx2) {
3548             maxBytes = 32;
3549         } else {
3550             maxBytes = 16;
3551         }
3552         if (avx1 && (typeString.equals(TYPE_FLOAT) || typeString.equals(TYPE_DOUBLE))) {
3553             maxBytes = avx512 ? 64 : 32;
3554         }
3555         if (avx512 && (typeString.equals(TYPE_BYTE) || typeString.equals(TYPE_SHORT) || typeString.equals(TYPE_CHAR))) {
3556             maxBytes = avx512bw ? 64 : 32;
3557         }
3558 
3559         return maxBytes;
3560     }
3561 
3562     /**
3563      * Return size in bytes of type named by {@code typeString}, return 0 if it does not name a type.
3564      */
3565     public static int getTypeSizeInBytes(String typeString) {
3566         return switch (typeString) {
3567             case TYPE_BYTE              -> 1;
3568             case TYPE_CHAR, TYPE_SHORT  -> 2;
3569             case TYPE_INT, TYPE_FLOAT   -> 4;
3570             case TYPE_LONG, TYPE_DOUBLE -> 8;
3571             default                     -> 0;
3572         };
3573     }
3574 
3575     /**
3576      * Returns "IRNode.XYZ", where XYZ is one of the IR node placeholder variable names defined above.
3577      */
3578     public static String getIRNodeAccessString(String irNodeString) {
3579         int prefixLength;
3580         if (isCompositeIRNode(irNodeString)) {
3581             TestFramework.check(irNodeString.length() > COMPOSITE_PREFIX.length() + POSTFIX.length(),
3582                                 "Invalid composite node placeholder: " + irNodeString);
3583             prefixLength = COMPOSITE_PREFIX.length();
3584         } else if (isVectorIRNode(irNodeString)) {
3585             TestFramework.check(irNodeString.length() > VECTOR_PREFIX.length() + POSTFIX.length(),
3586                                 "Invalid vector node placeholder: " + irNodeString);
3587             prefixLength = VECTOR_PREFIX.length();
3588         } else {
3589             prefixLength = PREFIX.length();
3590         }
3591         return "IRNode." + irNodeString.substring(prefixLength, irNodeString.length() - POSTFIX.length());
3592     }
3593 
3594     /**
3595      * Is this IR node supported on current platform, used VM build, etc.?
3596      * Throws a {@link CheckedTestFrameworkException} if the IR node is unsupported.
3597      */
3598     public static void checkIRNodeSupported(String node) throws CheckedTestFrameworkException {
3599         switch (node) {
3600             case INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP -> {
3601                 if (!WhiteBox.getWhiteBox().isJVMCISupportedByGC()) {
3602                     throw new CheckedTestFrameworkException("INTRINSIC_OR_TYPE_CHECKED_INLINING_TRAP is unsupported " +
3603                                                             "in builds without JVMCI.");
3604                 }
3605             }
3606             case CHECKCAST_ARRAYCOPY -> {
3607                 if (Platform.isS390x()) {
3608                     throw new CheckedTestFrameworkException("CHECKCAST_ARRAYCOPY is unsupported on s390.");
3609                 }
3610             }
3611             case IS_FINITE_D, IS_FINITE_F -> {
3612                 if (!Platform.isRISCV64()) {
3613                     throw new CheckedTestFrameworkException("IS_FINITE_* is only supported on riscv64.");
3614                 }
3615             }
3616             // default: do nothing -> IR node is supported and can be used by the user.
3617         }
3618     }
3619 
3620     /**
3621      * Get the regex of an IR node for a specific compile phase. If {@code irNode} is not an IR node placeholder string
3622      * or if there is no regex specified for {@code compilePhase}, a {@link TestFormatException} is reported.
3623      */
3624     public static String getRegexForCompilePhase(String irNode, CompilePhase compilePhase) {
3625         IRNodeMapEntry entry = IR_NODE_MAPPINGS.get(irNode);
3626         String failMsg = "IR Node \"" + irNode + "\" defined in class IRNode has no regex/compiler phase mapping " +
3627                          "(i.e. no static initializer block that adds a mapping entry to IRNode.IR_NODE_MAPPINGS)." +
3628                          System.lineSeparator() +
3629                          "   Have you just created the entry \"" + irNode + "\" in class IRNode and forgot to add a " +
3630                          "mapping?" + System.lineSeparator() +
3631                          "   Violation";
3632         TestFormat.checkNoReport(entry != null, failMsg);
3633         String regex = entry.regexForCompilePhase(compilePhase);
3634         failMsg = "IR Node \"" + irNode + "\" defined in class IRNode has no regex defined for compile phase "
3635                   + compilePhase + "." + System.lineSeparator() +
3636                   "   If you think this compile phase should be supported, update the mapping for \"" + irNode +
3637                   "\" in class IRNode (i.e the static initializer block immediately following the definition of \"" +
3638                   irNode + "\")." + System.lineSeparator() +
3639                   "   Violation";
3640         TestFormat.checkNoReport(regex != null, failMsg);
3641         return regex;
3642     }
3643 
3644     /**
3645      * Get the default phase of an IR node. If {@code irNode} is not an IR node placeholder string, a
3646      * {@link TestFormatException} is reported.
3647      */
3648     public static CompilePhase getDefaultPhase(String irNode) {
3649         IRNodeMapEntry entry = IR_NODE_MAPPINGS.get(irNode);
3650         String failMsg = "\"" + irNode + "\" is not an IR node defined in class IRNode and " +
3651                          "has therefore no default compile phase specified." + System.lineSeparator() +
3652                          "   If your regex represents a C2 IR node, consider adding an entry to class IRNode together " +
3653                          "with a static initializer block that adds a mapping to IRNode.IR_NODE_MAPPINGS." +
3654                          System.lineSeparator() +
3655                          "   Otherwise, set the @IR \"phase\" attribute to a compile phase different from " +
3656                          "CompilePhase.DEFAULT to explicitly tell the IR framework on which compile phase your rule" +
3657                          " should be applied on." + System.lineSeparator() +
3658                          "   Violation";
3659         TestFormat.checkNoReport(entry != null, failMsg);
3660         return entry.defaultCompilePhase();
3661     }
3662 
3663     public static String getVectorNodeType(String irNode) {
3664         String typeString = VECTOR_NODE_TYPE.get(irNode);
3665         String failMsg = "\"" + irNode + "\" is not a Vector IR node defined in class IRNode";
3666         TestFormat.check(typeString != null, failMsg);
3667         return typeString;
3668     }
3669 }