Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreEichenberger committed Sep 20, 2024
2 parents 168d50d + bf905d1 commit 30b37da
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions utils/mlir2FileCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,20 @@ def process_line(i, line):
new_line = process_name(new_line, def1_pat, "BLOCK_TILE_", ",", 1)
new_line = process_name(new_line, def2_pat, "BLOCK_IN_", " =", 1)
else:
definitions = def_qual_pat.findall(new_line)
def_qual_pat2 = re.compile(
r"((?:%(?:[a-zA-Z0-9][a-zA-Z0-9_\-]*)(?::\d+)?,?\s+)*)="
)
definitions = def_qual_pat2.findall(new_line)
for d in definitions:
(name, num) = d
x = use_name(name, num, " =")
y = record_name_def(name, num, "VAR_" + name, " =", 0, new_line)
new_line = new_line.replace(x, y)
arg_def_pat = re.compile(r"%([a-zA-Z0-9][a-zA-Z0-9_\-]*)(:\d+)?")
arg_defs = d.split(",")
for arg_def in arg_defs:
args = arg_def_pat.findall(arg_def)
for arg in args:
(name, num) = arg
x = use_name(name, num, "")
y = record_name_def(name, num, "VAR_" + name, "", 0, new_line)
new_line = new_line.replace(x, y)

# Process uses and map use.
uses = use_qual_pat.findall(new_line)
Expand Down

0 comments on commit 30b37da

Please sign in to comment.