[llvm] [AMDGPU][test]added remove duplicate options for update_mc_test_check script (PR #111769)
Ivan Kosarev via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 11 02:50:06 PDT 2024
================
@@ -298,23 +316,58 @@ def main():
else:
gen_prefix += getStdCheckLine(prefix, o, mc_mode)
- generated_prefixes.append(gen_prefix.rstrip("\n"))
+ generated_prefixes[input_line] = gen_prefix.rstrip("\n")
# write output
- prefix_id = 0
+ written_lines = set()
for input_info in ti.iterlines(output_lines):
input_line = input_info.line
- if isTestLine(input_line, mc_mode):
+ if input_line in testlines:
+ if ti.args.remove_duplicate:
+ if input_line in written_lines:
+ common.debug("Duplicated line skipped: ", input_line)
+ continue
+ else:
+ written_lines.add(input_line)
output_lines.append(input_line)
- output_lines.append(generated_prefixes[prefix_id])
- prefix_id += 1
+ output_lines.append(generated_prefixes[input_line])
elif should_add_line_to_output(input_line, prefix_set, mc_mode):
output_lines.append(input_line)
elif input_line in ti.run_lines or input_line == "":
output_lines.append(input_line)
+ # sort
+ if ti.args.sort:
+ # split with double newlines
+ lines = "\n".join(output_lines)
+ lines = lines.split("\n\n")
+
+ def compare(l1, l2):
+ # if contains multiple lines, just compare first line
----------------
kosarev wrote:
Shouldn't this try to skip leading comments? For cases like:
```
// FIXME: This test is incorrect because r128 assumes a 128-bit RSRC.
image_load v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D r128
// GFX12: encoding: [0x10,0x00,0x40,0xd0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
```
https://github.com/llvm/llvm-project/pull/111769
More information about the llvm-commits
mailing list