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