[Mlir-commits] [mlir] [mlir][generate-test-checks] Do not emit the autogenerated note if it exists (PR #143750)
Michael Maitland
llvmlistbot at llvm.org
Wed Jun 11 10:09:44 PDT 2025
https://github.com/michaelmaitland created https://github.com/llvm/llvm-project/pull/143750
Prior to this PR, the script removed the already existing autogenerated note if we came across a line that was equal to the note. But the default note is multiple lines, so there would never be a match. Instead, check to see if the current line is a substring of the autogenerated note.
>From 07111a8fb5ba30d4631b6b12d51414609a941f6f Mon Sep 17 00:00:00 2001
From: Michael Maitland <michaelmaitland at meta.com>
Date: Wed, 11 Jun 2025 10:04:02 -0700
Subject: [PATCH] [mlir][generate-test-checks] Do not emit the autogenerated
note if it exists
Prior to this PR, the script removed the already existing autogenerated
note if we came across a line that was equal to the note. But the
default note is multiple lines, so there would never be a match.
Instead, check to see if the current line is a substring of the
autogenerated note.
---
mlir/utils/generate-test-checks.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py
index 11fb4e40072e7..f77c9688d9318 100755
--- a/mlir/utils/generate-test-checks.py
+++ b/mlir/utils/generate-test-checks.py
@@ -208,7 +208,7 @@ def process_source_lines(source_lines, note, args):
source_segments = [[]]
for line in source_lines:
# Remove previous note.
- if line == note:
+ if line in note:
continue
# Remove previous CHECK lines.
if line.find(args.check_prefix) != -1:
More information about the Mlir-commits
mailing list