8280378: [IR Framework] Support IR matching for different compile phases

Reviewed-by: kvn, rcastanedalo
This commit is contained in:
Christian Hagedorn 2022-11-01 15:41:09 +00:00
parent da0ae5128a
commit f829b5a73f
142 changed files with 7489 additions and 1938 deletions

View file

@ -24,6 +24,7 @@
package compiler.lib.ir_framework;
import compiler.lib.ir_framework.driver.irmatching.IRViolationException;
import compiler.lib.ir_framework.shared.TestFormatException;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
@ -84,6 +85,15 @@ public @interface IR {
*/
String[] counts() default {};
/**
* Define a list of {@link CompilePhase} enums to apply the IR rule constraint attributes {@link #failOn()} and/or
* {@link #counts()} on. By default, IR matching is applied on the predefined default phase of an IR node
* placeholder string as defined in {@link IRNode}. For non-IR node constraints (i.e. user-defined regexes with no
* definition in {@link IRNode}), a compile phase must explicitly be set. Otherwise, a {@link TestFormatException}
* is reported.
*/
CompilePhase[] phase() default { CompilePhase.DEFAULT };
/**
* Define a single VM flag precondition which <i>must hold</i> when applying the IR rule. If the VM flag precondition
* fails, then the IR rule is not applied. This is useful if a commonly used flag alters the IR in such a way that an IR rule