@@ -982,6 +982,7 @@ def get_failed_prefixes(self):
982982##### Generator of LLVM IR CHECK lines
983983
984984SCRUB_IR_COMMENT_RE = re .compile (r"\s*;.*" )
985+ SCRUB_IR_FUNC_META_RE = re .compile (r'((?:\!(?!dbg\b)[a-zA-Z_]\w*(?:\s+![0-9]+)?)\s*)+' )
985986
986987# TODO: We should also derive check lines for global, debug, loop declarations, etc..
987988
@@ -1086,13 +1087,15 @@ def __init__(
10861087 nameless_values : List [NamelessValue ],
10871088 regexp_prefix ,
10881089 regexp_suffix ,
1090+ no_meta_details = False
10891091 ):
10901092 self ._version = version
10911093 self ._mode = mode
10921094 self ._nameless_values = nameless_values
10931095
10941096 self ._regexp_prefix = regexp_prefix
10951097 self ._regexp_suffix = regexp_suffix
1098+ self ._no_meta_details = no_meta_details
10961099
10971100 self ._regexp , _ = self ._build_regexp (False , False )
10981101 (
@@ -1146,6 +1149,9 @@ def get_regexp(self):
11461149 def get_unstable_globals_regexp (self ):
11471150 return self ._unstable_globals_regexp
11481151
1152+ def no_meta_details (self ):
1153+ return self ._no_meta_details
1154+
11491155 # The entire match is group 0, the prefix has one group (=1), the entire
11501156 # IR_VALUE_REGEXP_STRING is one group (=2), and then the nameless values start.
11511157 FIRST_NAMELESS_GROUP_IN_MATCH = 3
@@ -1174,7 +1180,7 @@ def get_nameless_value_from_match(self, match) -> NamelessValue:
11741180 return self .get_match_info (match )[1 ]
11751181
11761182
1177- def make_ir_generalizer (version ):
1183+ def make_ir_generalizer (version , no_meta_details ):
11781184 values = []
11791185
11801186 if version >= 5 :
@@ -1223,7 +1229,7 @@ def make_ir_generalizer(version):
12231229 # not (unstable_ids_only and nameless_value.match_literally)
12241230 # ]
12251231
1226- return GeneralizerInfo (version , GeneralizerInfo .MODE_IR , values , prefix , suffix )
1232+ return GeneralizerInfo (version , GeneralizerInfo .MODE_IR , values , prefix , suffix , no_meta_details )
12271233
12281234
12291235def make_asm_generalizer (version ):
@@ -1725,6 +1731,7 @@ def generalize_check_lines(
17251731 original_check_lines = None ,
17261732 * ,
17271733 unstable_globals_only = False ,
1734+ no_meta_details = False ,
17281735):
17291736 if unstable_globals_only :
17301737 regexp = ginfo .get_unstable_globals_regexp ()
@@ -1754,6 +1761,9 @@ def escape_braces(match_obj):
17541761 break
17551762 # Ignore any comments, since the check lines will too.
17561763 scrubbed_line = SCRUB_IR_COMMENT_RE .sub (r"" , line )
1764+ # Ignore the metadata details if check global is none
1765+ if no_meta_details :
1766+ scrubbed_line = SCRUB_IR_FUNC_META_RE .sub (r"{{.*}}" , scrubbed_line )
17571767 lines [i ] = scrubbed_line
17581768
17591769 if not preserve_names :
@@ -1985,6 +1995,7 @@ def add_checks(
19851995 global_vars_seen ,
19861996 preserve_names ,
19871997 original_check_lines = [],
1998+ no_meta_details = ginfo .no_meta_details ()
19881999 )[0 ]
19892000 func_name_separator = func_dict [checkprefix ][func_name ].func_name_separator
19902001 if "[[" in args_and_sig :
0 commit comments