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