|
35 | 35 |
|
36 | 36 | ADVERT_BEGIN = "// NOTE: Assertions have been autogenerated by " |
37 | 37 | ADVERT_END = """ |
38 | | -// The script is designed to make adding checks to |
39 | | -// a test case fast, it is *not* designed to be authoritative |
40 | | -// about what constitutes a good test! The CHECK should be |
41 | | -// minimized and named to reflect the test intent. |
| 38 | +// This script is intended to make adding checks to a test case quick and easy. |
| 39 | +// It is *not* authoritative about what constitutes a good test. After using the |
| 40 | +// script, be sure to review and refine the generated checks. For example, |
| 41 | +// CHECK lines should be minimized and named to reflect the test’s intent. |
| 42 | +// For comprehensive guidelines, see: |
| 43 | +// * https://mlir.llvm.org/getting_started/TestingGuide/ |
42 | 44 | """ |
43 | 45 |
|
44 | 46 |
|
45 | 47 | # Regex command to match an SSA identifier. |
46 | 48 | SSA_RE_STR = "[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*" |
47 | 49 | SSA_RE = re.compile(SSA_RE_STR) |
48 | 50 |
|
49 | | -# Regex matching `dialect.op_name`, where `dialect` is an upstream MLIR |
50 | | -# dialect (e.g. `vector.transfer_read`). |
51 | | -DIALECTS = "acc|affine|amdgpu|amx|arith|arm_neon|arm_sve|arm_sme|async|bufferization|cf|complex|dlti|emitc|\ |
52 | | - func|gpu|index|irdl|linalg|llvm|math|memref|ml_program|mpi|nvgpu|nvvm|omp|pdl_interp|pdl|ptr|quant|\ |
53 | | - rocdl|scf|shape|shard|smt|sparse_tensor|tensor|ub|vcix|vector|wasmssa|x86vector|xegpu|xevm|spirv|tosa|\ |
54 | | - transform" |
55 | | -SSA_OP_NAME_RE = re.compile(rf"\b(?:{DIALECTS})[.]([a-z_]+)\b") |
| 51 | +# Regex matching `dialect.op_name` (e.g. `vector.transfer_read`). |
| 52 | +SSA_OP_NAME_RE = re.compile(r"\b(?:\s=\s[a-z_]+)[.]([a-z_]+)\b") |
56 | 53 |
|
57 | 54 | # Regex matching the left-hand side of an assignment |
58 | 55 | SSA_RESULTS_STR = r'\s*(%' + SSA_RE_STR + r')(\s*,\s*(%' + SSA_RE_STR + r'))*\s*=' |
|
0 commit comments