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