diff --git a/compiler_gym/third_party/inst2vec/inst2vec_preprocess.py b/compiler_gym/third_party/inst2vec/inst2vec_preprocess.py index 3c75706ac..3a07f0fca 100644 --- a/compiler_gym/third_party/inst2vec/inst2vec_preprocess.py +++ b/compiler_gym/third_party/inst2vec/inst2vec_preprocess.py @@ -339,16 +339,16 @@ def preprocess(data): # XFG-transforming (inline and abstract statements) ######################################################################################################################## # Helper regexs for structure type inlining -vector_type = "<\d+ x " + rgx.first_class_type + ">" -array_type = "\[\d+ x " + rgx.first_class_type + "\]" -array_of_array_type = "\[\d+ x " + "\[\d+ x " + rgx.first_class_type + "\]" + "\]" +vector_type = r"<\d+ x " + rgx.first_class_type + r">" +array_type = r"\[\d+ x " + rgx.first_class_type + r"\]" +array_of_array_type = r"\[\d+ x " + r"\[\d+ x " + rgx.first_class_type + r"\]" + r"\]" function_type = ( rgx.first_class_type - + " \(" + + r" \(" + rgx.any_of([rgx.first_class_type, vector_type, array_type, "..."], ",") + "*" + rgx.any_of([rgx.first_class_type, vector_type, array_type, "..."]) - + "\)\**" + + r"\)\**" ) structure_entry = rgx.any_of( [ @@ -460,7 +460,7 @@ def construct_struct_types_dictionary_for_file(data): struct_prev.append(comp_structure) struct_prev_with_comma.append(comp_structure + ", ") else: - comp_structure = "{}\dx\[\]\(\)\.,\*%IDvfloatdubeipqcy]+}>?$" + comp_structure = r"{}\dx\[\]\(\)\.,\*%IDvfloatdubeipqcy]+}>?$" # Loop over contents of to_process for i in list(to_process.items()): diff --git a/compiler_gym/third_party/inst2vec/rgx_utils.py b/compiler_gym/third_party/inst2vec/rgx_utils.py index c6f11a32a..9454ece10 100644 --- a/compiler_gym/third_party/inst2vec/rgx_utils.py +++ b/compiler_gym/third_party/inst2vec/rgx_utils.py @@ -29,58 +29,58 @@ # Regex manipulation: helper functions ######################################################################################################################## def any_of(possibilities, to_add=""): - """ + r""" Helper function for regex manipulation: Construct a regex representing "any of" the given possibilities :param possibilities: list of strings representing different word possibilities :param to_add: string to add at the beginning of each possibility (optional) :return: string corresponding to regex which represents any of the given possibilities - """ + r""" assert len(possibilities) > 0 - s = "(?:" + s = r"(?:" if len(to_add) > 0: - s += possibilities[0] + to_add + " " + s += possibilities[0] + to_add + r" " else: s += possibilities[0] for i in range(len(possibilities) - 1): if len(to_add) > 0: - s += "|" + possibilities[i + 1] + to_add + " " + s += r"|" + possibilities[i + 1] + to_add + r" " else: - s += "|" + possibilities[i + 1] - return s + ")" + s += r"|" + possibilities[i + 1] + return s + r")" ######################################################################################################################## # Regex manipulation: helper variables ######################################################################################################################## # Identifiers -global_id = r'(?" + + r"|undef))*>" ) immediate_value_vector_int = ( - r"" + + r"|undef))*>" ) immediate_value_vector_float = ( r"" + + r"|undef))*>" ) immediate_value_vector_double = ( r"" + + r"|undef))*>" ) immediate_value_string = r'(?\(\) \*]+>|\(["\@\d\w\.\-\_:,<> \*]+\)|\w+)?::[" \@\d\w\.\-\_:\)\(]*)*' + r'%[r"\@\d\w\.\-\_:]+(?:(?:<[r"\@\d\w\.\-\_:,<>\(\) \*]+>|\([r"\@\d\w\.\-\_:,<> \*]+\)|\w+)?::[r" \@\d\w\.\-\_:\)\(]*)*' + struct_name_add_on ) struct_name = struct_name_without_lookahead + struct_lookahead @@ -207,32 +207,32 @@ def any_of(possibilities, to_add=""): # Types base_type = r"(?:i\d+|double|float|opaque)\**" first_class_types = [ - "i\d+", - "half", - "float", - "double", - "fp_128", - "x86_fp80", - "ppc_fp128", - "<%ID>", + r"i\d+", + r"half", + r"float", + r"double", + r"fp_128", + r"x86_fp80", + r"ppc_fp128", + r"<%ID>", ] -first_class_type = any_of(first_class_types) + "\**" +first_class_type = any_of(first_class_types) + r"\**" base_type_or_struct_name = any_of([base_type, struct_name_without_lookahead]) ptr_to_base_type = base_type + r"\*+" vector_type = r"<\d+ x " + base_type + r">" ptr_to_vector_type = vector_type + r"\*+" array_type = r"\[\d+ x " + base_type + r"\]" ptr_to_array_type = array_type + r"\*+" -array_of_array_type = "\[\d+ x " + "\[\d+ x " + base_type + "\]" + "\]" +array_of_array_type = r"\[\d+ x " + r"\[\d+ x " + base_type + r"\]" + r"\]" struct = struct_name_without_lookahead ptr_to_struct = struct + r"\*+" function_type = ( base_type - + " \(" + + r" \(" + any_of([base_type, vector_type, array_type, "..."], ",") - + "*" + + r"*" + any_of([base_type, vector_type, array_type, "..."]) - + "\)\**" + + r"\)\**" ) any_type = any_of( [ @@ -269,586 +269,586 @@ def any_of(possibilities, to_add=""): [base_type, vector_type, array_type, array_of_array_type, function_type], "," ) literal_structure = ( - "(?|{})" + r"(?|{})" ) # Tokens -unknown_token = "!UNK" # starts with '!' to guarantee it will appear first in the alphabetically sorted vocabulary +unknown_token = r"!UNK" # starts with '!' to guarantee it will appear first in the alphabetically sorted vocabulary ######################################################################################################################## # Tags for clustering statements (by statement semantics) and helper functions ######################################################################################################################## # List of families of operations llvm_IR_stmt_families = [ - # ["tag level 1", "tag level 2", "tag level 3", "regex" ] - ["unknown token", "unknown token", "unknown token", "!UNK"], - ["integer arithmetic", "addition", "add integers", "<%ID> = add .*"], - ["integer arithmetic", "subtraction", "subtract integers", "<%ID> = sub .*"], + # [r"tag level 1", r"tag level 2", r"tag level 3", r"regex" ] + [r"unknown token", "unknown token", "unknown token", "!UNK"], + [r"integer arithmetic", "addition", "add integers", "<%ID> = add .*"], + [r"integer arithmetic", "subtraction", "subtract integers", "<%ID> = sub .*"], [ - "integer arithmetic", - "multiplication", - "multiply integers", - "<%ID> = mul .*", + r"integer arithmetic", + r"multiplication", + r"multiply integers", + r"<%ID> = mul .*", ], [ - "integer arithmetic", - "division", - "unsigned integer division", - "<%ID> = udiv .*", + r"integer arithmetic", + r"division", + r"unsigned integer division", + r"<%ID> = udiv .*", ], [ - "integer arithmetic", - "division", - "signed integer division", - "<%ID> = sdiv .*", + r"integer arithmetic", + r"division", + r"signed integer division", + r"<%ID> = sdiv .*", ], [ - "integer arithmetic", - "remainder", - "remainder of signed div", - "<%ID> = srem .*", + r"integer arithmetic", + r"remainder", + r"remainder of signed div", + r"<%ID> = srem .*", ], [ - "integer arithmetic", - "remainder", - "remainder of unsigned div.", - "<%ID> = urem .*", + r"integer arithmetic", + r"remainder", + r"remainder of unsigned div.", + r"<%ID> = urem .*", ], - ["floating-point arithmetic", "addition", "add floats", "<%ID> = fadd .*"], + [r"floating-point arithmetic", "addition", "add floats", "<%ID> = fadd .*"], [ - "floating-point arithmetic", - "subtraction", - "subtract floats", - "<%ID> = fsub .*", + r"floating-point arithmetic", + r"subtraction", + r"subtract floats", + r"<%ID> = fsub .*", ], [ - "floating-point arithmetic", - "multiplication", - "multiply floats", - "<%ID> = fmul .*", + r"floating-point arithmetic", + r"multiplication", + r"multiply floats", + r"<%ID> = fmul .*", ], - ["floating-point arithmetic", "division", "divide floats", "<%ID> = fdiv .*"], - ["bitwise arithmetic", "and", "and", "<%ID> = and .*"], - ["bitwise arithmetic", "or", "or", "<%ID> = or .*"], - ["bitwise arithmetic", "xor", "xor", "<%ID> = xor .*"], - ["bitwise arithmetic", "shift left", "shift left", "<%ID> = shl .*"], - ["bitwise arithmetic", "arithmetic shift right", "ashr", "<%ID> = ashr .*"], + [r"floating-point arithmetic", "division", "divide floats", "<%ID> = fdiv .*"], + [r"bitwise arithmetic", "and", "and", "<%ID> = and .*"], + [r"bitwise arithmetic", "or", "or", "<%ID> = or .*"], + [r"bitwise arithmetic", "xor", "xor", "<%ID> = xor .*"], + [r"bitwise arithmetic", "shift left", "shift left", "<%ID> = shl .*"], + [r"bitwise arithmetic", "arithmetic shift right", "ashr", "<%ID> = ashr .*"], [ - "bitwise arithmetic", - "logical shift right", - "logical shift right", - "<%ID> = lshr .*", + r"bitwise arithmetic", + r"logical shift right", + r"logical shift right", + r"<%ID> = lshr .*", ], [ - "comparison operation", - "compare integers", - "compare integers", - "<%ID> = icmp .*", + r"comparison operation", + r"compare integers", + r"compare integers", + r"<%ID> = icmp .*", ], [ - "comparison operation", - "compare floats", - "compare floats", - "<%ID> = fcmp .*", + r"comparison operation", + r"compare floats", + r"compare floats", + r"<%ID> = fcmp .*", ], [ - "conversion operation", - "bitcast", - "bitcast single val", - "<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque) .* to .*", + r"conversion operation", + r"bitcast", + r"bitcast single val", + r"<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque) .* to .*", ], [ - "conversion operation", - "bitcast", - "bitcast single val*", - "<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\* .* to .*", + r"conversion operation", + r"bitcast", + r"bitcast single val*", + r"<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\* .* to .*", ], [ - "conversion operation", - "bitcast", - "bitcast single val**", - "<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\* .* to .*", + r"conversion operation", + r"bitcast", + r"bitcast single val**", + r"<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\* .* to .*", ], [ - "conversion operation", - "bitcast", - "bitcast single val***", - "<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\*\* .* to .*", + r"conversion operation", + r"bitcast", + r"bitcast single val***", + r"<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\*\* .* to .*", ], [ - "conversion operation", - "bitcast", - "bitcast single val****", - "<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\*\*\* .* to .*", + r"conversion operation", + r"bitcast", + r"bitcast single val****", + r"<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\*\*\* .* to .*", ], [ - "conversion operation", - "bitcast", - "bitcast array", - "<%ID> = bitcast \[\d.* to .*", + r"conversion operation", + r"bitcast", + r"bitcast array", + r"<%ID> = bitcast \[\d.* to .*", ], [ - "conversion operation", - "bitcast", - "bitcast vector", - "<%ID> = bitcast <\d.* to .*", + r"conversion operation", + r"bitcast", + r"bitcast vector", + r"<%ID> = bitcast <\d.* to .*", ], [ - "conversion operation", - "bitcast", - "bitcast structure", - '<%ID> = bitcast (%"|<{|<%|{).* to .*', + r"conversion operation", + r"bitcast", + r"bitcast structure", + r'<%ID> = bitcast (%"|<{|<%|{).* to .*', ], - ["conversion operation", "bitcast", "bitcast void", "<%ID> = bitcast void "], + [r"conversion operation", "bitcast", "bitcast void", "<%ID> = bitcast void "], [ - "conversion operation", - "extension/truncation", - "extend float", - "<%ID> = fpext .*", + r"conversion operation", + r"extension/truncation", + r"extend float", + r"<%ID> = fpext .*", ], [ - "conversion operation", - "extension/truncation", - "truncate floats", - "<%ID> = fptrunc .*", + r"conversion operation", + r"extension/truncation", + r"truncate floats", + r"<%ID> = fptrunc .*", ], [ - "conversion operation", - "extension/truncation", - "sign extend ints", - "<%ID> = sext .*", + r"conversion operation", + r"extension/truncation", + r"sign extend ints", + r"<%ID> = sext .*", ], [ - "conversion operation", - "extension/truncation", - "truncate int to ... ", - "<%ID> = trunc .* to .*", + r"conversion operation", + r"extension/truncation", + r"truncate int to ... ", + r"<%ID> = trunc .* to .*", ], [ - "conversion operation", - "extension/truncation", - "zero extend integers", - "<%ID> = zext .*", + r"conversion operation", + r"extension/truncation", + r"zero extend integers", + r"<%ID> = zext .*", ], [ - "conversion operation", - "convert", - "convert signed integers to... ", - "<%ID> = sitofp .*", + r"conversion operation", + r"convert", + r"convert signed integers to... ", + r"<%ID> = sitofp .*", ], [ - "conversion operation", - "convert", - "convert unsigned integer to... ", - "<%ID> = uitofp .*", + r"conversion operation", + r"convert", + r"convert unsigned integer to... ", + r"<%ID> = uitofp .*", ], [ - "conversion operation", - "convert int to ptr", - "convert int to ptr", - "<%ID> = inttoptr .*", + r"conversion operation", + r"convert int to ptr", + r"convert int to ptr", + r"<%ID> = inttoptr .*", ], [ - "conversion operation", - "convert ptr to int", - "convert ptr to int", - "<%ID> = ptrtoint .*", + r"conversion operation", + r"convert ptr to int", + r"convert ptr to int", + r"<%ID> = ptrtoint .*", ], [ - "conversion operation", - "convert floats", - "convert float to sint", - "<%ID> = fptosi .*", + r"conversion operation", + r"convert floats", + r"convert float to sint", + r"<%ID> = fptosi .*", ], [ - "conversion operation", - "convert floats", - "convert float to uint", - "<%ID> = fptoui .*", + r"conversion operation", + r"convert floats", + r"convert float to uint", + r"<%ID> = fptoui .*", ], - ["control flow", "phi", "phi", "<%ID> = phi .*"], + [r"control flow", "phi", "phi", "<%ID> = phi .*"], [ - "control flow", - "switch", - "jump table line", - "i\d{1,2} <(INT|FLOAT)>, label <%ID>", + r"control flow", + r"switch", + r"jump table line", + r"i\d{1,2} <(INT|FLOAT)>, label <%ID>", ], - ["control flow", "select", "select", "<%ID> = select .*"], - ["control flow", "invoke", "invoke and ret type", "<%ID> = invoke .*"], - ["control flow", "invoke", "invoke void", "invoke (fastcc )?void .*"], - ["control flow", "branch", "branch conditional", "br i1 .*"], - ["control flow", "branch", "branch unconditional", "br label .*"], - ["control flow", "branch", "branch indirect", "indirectbr .*"], - ["control flow", "control flow", "switch", "switch .*"], - ["control flow", "return", "return", "ret .*"], - ["control flow", "resume", "resume", "resume .*"], - ["control flow", "unreachable", "unreachable", "unreachable.*"], - ["control flow", "exception handling", "catch block", "catch .*"], - ["control flow", "exception handling", "cleanup clause", "cleanup"], + [r"control flow", "select", "select", "<%ID> = select .*"], + [r"control flow", "invoke", "invoke and ret type", "<%ID> = invoke .*"], + [r"control flow", "invoke", "invoke void", "invoke (fastcc )?void .*"], + [r"control flow", "branch", "branch conditional", "br i1 .*"], + [r"control flow", "branch", "branch unconditional", "br label .*"], + [r"control flow", "branch", "branch indirect", "indirectbr .*"], + [r"control flow", "control flow", "switch", "switch .*"], + [r"control flow", "return", "return", "ret .*"], + [r"control flow", "resume", "resume", "resume .*"], + [r"control flow", "unreachable", "unreachable", "unreachable.*"], + [r"control flow", "exception handling", "catch block", "catch .*"], + [r"control flow", "exception handling", "cleanup clause", "cleanup"], [ - "control flow", - "exception handling", - "landingpad for exceptions", - "<%ID> = landingpad .", + r"control flow", + r"exception handling", + r"landingpad for exceptions", + r"<%ID> = landingpad .", ], [ - "function", - "function call", - "sqrt (llvm-intrinsic)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>) @(llvm|llvm\..*)\.sqrt.*", + r"function", + r"function call", + r"sqrt (llvm-intrinsic)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>) @(llvm|llvm\..*)\.sqrt.*", ], [ - "function", - "function call", - "fabs (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.fabs.*", + r"function", + r"function call", + r"fabs (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.fabs.*", ], [ - "function", - "function call", - "max (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.max.*", + r"function", + r"function call", + r"max (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.max.*", ], [ - "function", - "function call", - "min (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.min.*", + r"function", + r"function call", + r"min (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.min.*", ], [ - "function", - "function call", - "fma (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.fma.*", + r"function", + r"function call", + r"fma (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.fma.*", ], [ - "function", - "function call", - "phadd (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.phadd.*", + r"function", + r"function call", + r"phadd (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.phadd.*", ], [ - "function", - "function call", - "pabs (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.pabs.*", + r"function", + r"function call", + r"pabs (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.pabs.*", ], [ - "function", - "function call", - "pmulu (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.pmulu.*", + r"function", + r"function call", + r"pmulu (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.pmulu.*", ], [ - "function", - "function call", - "umul (llvm-intr.)", - "<%ID> = (tail |musttail |notail )?call {.*} @llvm\.umul.*", + r"function", + r"function call", + r"umul (llvm-intr.)", + r"<%ID> = (tail |musttail |notail )?call {.*} @llvm\.umul.*", ], [ - "function", - "function call", - "prefetch (llvm-intr.)", - "(tail |musttail |notail )?call void @llvm\.prefetch.*", + r"function", + r"function call", + r"prefetch (llvm-intr.)", + r"(tail |musttail |notail )?call void @llvm\.prefetch.*", ], [ - "function", - "function call", - "trap (llvm-intr.)", - "(tail |musttail |notail )?call void @llvm\.trap.*", + r"function", + r"function call", + r"trap (llvm-intr.)", + r"(tail |musttail |notail )?call void @llvm\.trap.*", ], - ["function", "func decl / def", "function declaration", "declare .*"], - ["function", "func decl / def", "function definition", "define .*"], + [r"function", "func decl / def", "function declaration", "declare .*"], + [r"function", "func decl / def", "function definition", "define .*"], [ - "function", - "function call", - "function call void", - "(tail |musttail |notail )?call( \w+)? void [\w\)\(\}\{\.\,\*\d\[\]\s<>%]*(<[@%]ID>\(|.*bitcast )", + r"function", + r"function call", + r"function call void", + r"(tail |musttail |notail )?call( \w+)? void [\w\)\(\}\{\.\,\*\d\[\]\s<>%]*(<[@%]ID>\(|.*bitcast )", ], [ - "function", - "function call", - "function call mem lifetime", - "(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.lifetime.*", + r"function", + r"function call", + r"function call mem lifetime", + r"(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.lifetime.*", ], [ - "function", - "function call", - "function call mem copy", - "(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.memcpy\..*", + r"function", + r"function call", + r"function call mem copy", + r"(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.memcpy\..*", ], [ - "function", - "function call", - "function call mem set", - "(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.memset\..*", + r"function", + r"function call", + r"function call mem set", + r"(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.memset\..*", ], [ - "function", - "function call", - "function call single val", - "<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80|<\d+ x (i\d+|float|double)>) (.*<[@%]ID>\(|(\(.*\) )?bitcast ).*", + r"function", + r"function call", + r"function call single val", + r"<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80|<\d+ x (i\d+|float|double)>) (.*<[@%]ID>\(|(\(.*\) )?bitcast ).*", ], [ - "function", - "function call", - "function call single val*", - "<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80)\* (.*<[@%]ID>\(|\(.*\) bitcast ).*", + r"function", + r"function call", + r"function call single val*", + r"<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80)\* (.*<[@%]ID>\(|\(.*\) bitcast ).*", ], [ - "function", - "function call", - "function call single val**", - "<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80)\*\* (.*<[@%]ID>\(|\(.*\) bitcast ).*", + r"function", + r"function call", + r"function call single val**", + r"<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80)\*\* (.*<[@%]ID>\(|\(.*\) bitcast ).*", ], [ - "function", - "function call", - "function call array", - "<%ID> = (tail |musttail |notail )?call[^{]* \[.*\] (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )", + r"function", + r"function call", + r"function call array", + r"<%ID> = (tail |musttail |notail )?call[^{]* \[.*\] (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )", ], [ - "function", - "function call", - "function call array*", - "<%ID> = (tail |musttail |notail )?call[^{]* \[.*\]\* (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )", + r"function", + r"function call", + r"function call array*", + r"<%ID> = (tail |musttail |notail )?call[^{]* \[.*\]\* (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )", ], [ - "function", - "function call", - "function call array**", - "<%ID> = (tail |musttail |notail )?call[^{]* \[.*\]\*\* (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )", + r"function", + r"function call", + r"function call array**", + r"<%ID> = (tail |musttail |notail )?call[^{]* \[.*\]\*\* (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )", ], [ - "function", - "function call", - "function call structure", - "<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>) (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", + r"function", + r"function call", + r"function call structure", + r"<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>) (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", ], [ - "function", - "function call", - "function call structure*", - "<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>)\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", + r"function", + r"function call", + r"function call structure*", + r"<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>)\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", ], [ - "function", - "function call", - "function call structure**", - "<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>)\*\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", + r"function", + r"function call", + r"function call structure**", + r"<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>)\*\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", ], [ - "function", - "function call", - "function call structure***", - "<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>)\*\*\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", + r"function", + r"function call", + r"function call structure***", + r"<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|?|opaque|\{\}|<%ID>)\*\*\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )", ], [ - "function", - "function call", - "function call asm value", - "<%ID> = (tail |musttail |notail )?call.* asm .*", + r"function", + r"function call", + r"function call asm value", + r"<%ID> = (tail |musttail |notail )?call.* asm .*", ], [ - "function", - "function call", - "function call asm void", - "(tail |musttail |notail )?call void asm .*", + r"function", + r"function call", + r"function call asm void", + r"(tail |musttail |notail )?call void asm .*", ], [ - "function", - "function call", - "function call function", - "<%ID> = (tail |musttail |notail )?call[^{]* void \([^\(\)]*\)\** <[@%]ID>\(", + r"function", + r"function call", + r"function call function", + r"<%ID> = (tail |musttail |notail )?call[^{]* void \([^\(\)]*\)\** <[@%]ID>\(", ], [ - "global variables", - "glob. var. definition", - "???", - "<@ID> = (?!.*constant)(?!.*alias).*", + r"global variables", + r"glob. var. definition", + r"???", + r"<@ID> = (?!.*constant)(?!.*alias).*", ], - ["global variables", "constant definition", "???", "<@ID> = .*constant .*"], + [r"global variables", "constant definition", "???", "<@ID> = .*constant .*"], [ - "memory access", - "load from memory", - "load structure", - '<%ID> = load (\w* )?(%"|<\{|\{ <|\{ \[|\{ |<%|opaque).*', + r"memory access", + r"load from memory", + r"load structure", + r'<%ID> = load (\w* )?(%"|<\{|\{ <|\{ \[|\{ |<%|opaque).*', ], [ - "memory access", - "load from memory", - "load single val", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)[, ].*", + r"memory access", + r"load from memory", + r"load single val", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)[, ].*", ], [ - "memory access", - "load from memory", - "load single val*", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*[, ].*", + r"memory access", + r"load from memory", + r"load single val*", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*[, ].*", ], [ - "memory access", - "load from memory", - "load single val**", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*[, ].*", + r"memory access", + r"load from memory", + r"load single val**", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*[, ].*", ], [ - "memory access", - "load from memory", - "load single val***", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*[, ].*", + r"memory access", + r"load from memory", + r"load single val***", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*[, ].*", ], [ - "memory access", - "load from memory", - "load single val****", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*[, ].*", + r"memory access", + r"load from memory", + r"load single val****", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*[, ].*", ], [ - "memory access", - "load from memory", - "load single val*****", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*[, ].*", + r"memory access", + r"load from memory", + r"load single val*****", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*[, ].*", ], [ - "memory access", - "load from memory", - "load single val******", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*\*[, ].*", + r"memory access", + r"load from memory", + r"load single val******", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*\*[, ].*", ], [ - "memory access", - "load from memory", - "load single val*******", - "<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*\*\*[, ].*", + r"memory access", + r"load from memory", + r"load single val*******", + r"<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*\*\*[, ].*", ], [ - "memory access", - "load from memory", - "load vector", - "<%ID> = load <\d+ x .*", + r"memory access", + r"load from memory", + r"load vector", + r"<%ID> = load <\d+ x .*", ], - ["memory access", "load from memory", "load array", "<%ID> = load \[\d.*"], + ["memory access", "load from memory", "load array", r"<%ID> = load \[\d.*"], [ - "memory access", - "load from memory", - "load fction ptr", - "<%ID> = load void \(", + r"memory access", + r"load from memory", + r"load fction ptr", + r"<%ID> = load void \(", ], - ["memory access", "store", "store", "store.*"], - ["memory addressing", "GEP", "GEP", "<%ID> = getelementptr .*"], + [r"memory access", "store", "store", "store.*"], + [r"memory addressing", "GEP", "GEP", r"<%ID> = getelementptr .*"], [ - "memory allocation", - "allocate on stack", - "allocate structure", - '<%ID> = alloca (%"|<{|<%|{ |opaque).*', + r"memory allocation", + r"allocate on stack", + r"allocate structure", + r'<%ID> = alloca (%"|<{|<%|{ |opaque).*', ], [ - "memory allocation", - "allocate on stack", - "allocate vector", - "<%ID> = alloca <\d.*", + r"memory allocation", + r"allocate on stack", + r"allocate vector", + r"<%ID> = alloca <\d.*", ], [ - "memory allocation", - "allocate on stack", - "allocate array", - "<%ID> = alloca \[\d.*", + r"memory allocation", + r"allocate on stack", + r"allocate array", + r"<%ID> = alloca \[\d.*", ], [ - "memory allocation", - "allocate on stack", - "allocate single value", - "<%ID> = alloca (double|float|i\d{1,3})\*?.*", + r"memory allocation", + r"allocate on stack", + r"allocate single value", + r"<%ID> = alloca (double|float|i\d{1,3})\*?.*", ], [ - "memory allocation", - "allocate on stack", - "allocate void", - "<%ID> = alloca void \(.*", + r"memory allocation", + r"allocate on stack", + r"allocate void", + r"<%ID> = alloca void \(.*", ], [ - "memory atomics", - "atomic memory modify", - "atomicrw xchg", - "<%ID> = atomicrmw.* xchg .*", + r"memory atomics", + r"atomic memory modify", + r"atomicrw xchg", + r"<%ID> = atomicrmw.* xchg .*", ], [ - "memory atomics", - "atomic memory modify", - "atomicrw add", - "<%ID> = atomicrmw.* add .*", + r"memory atomics", + r"atomic memory modify", + r"atomicrw add", + r"<%ID> = atomicrmw.* add .*", ], [ - "memory atomics", - "atomic memory modify", - "atomicrw sub", - "<%ID> = atomicrmw.* sub .*", + r"memory atomics", + r"atomic memory modify", + r"atomicrw sub", + r"<%ID> = atomicrmw.* sub .*", ], [ - "memory atomics", - "atomic memory modify", - "atomicrw or", - "<%ID> = atomicrmw.* or .*", + r"memory atomics", + r"atomic memory modify", + r"atomicrw or", + r"<%ID> = atomicrmw.* or .*", ], [ - "memory atomics", - "atomic compare exchange", - "cmpxchg single val", - "<%ID> = cmpxchg (weak )?(i\d+|float|double|x86_fp80)\*", + r"memory atomics", + r"atomic compare exchange", + r"cmpxchg single val", + r"<%ID> = cmpxchg (weak )?(i\d+|float|double|x86_fp80)\*", ], [ - "non-instruction", - "label", - "label declaration", - ";