diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -479,6 +479,9 @@ # prefix_exclusions are prefixes we cannot use to print the function because it doesn't exist in run lines that use these prefixes as well. prefix_exclusions = set() printed_prefixes = [] + # A mapping of prefixes to the run lines they exist in. + prefix_to_lines = {} + for p in prefix_list: checkprefixes = p[0] # If not all checkprefixes of this run line produced the function we cannot check for it as it does not @@ -487,6 +490,11 @@ if any(map(lambda checkprefix: func_name not in func_dict[checkprefix], checkprefixes)): prefix_exclusions |= set(checkprefixes) continue + for prefix in checkprefixes: + if prefix not in prefix_to_lines: + prefix_to_lines[prefix] = [] + prefix_to_lines[prefix].append(p) + # prefix_exclusions is constructed, we can now emit the output for p in prefix_list: @@ -515,6 +523,9 @@ vars_seen = set() printed_prefixes.append(checkprefix) + # For this function we can't use any of the other prefixes that exists in the run lines + # that this prefix is in. + prefix_exclusions |= { prefix for prefix in p[0] for p in prefix_to_lines[prefix] } attrs = str(func_dict[checkprefix][func_name].attrs) attrs = '' if attrs == 'None' else attrs if attrs: