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