[Mlir-commits] [mlir] 74172ad - [mlir][generate-test-checks] Do not emit the autogenerated note if it exists (#143750)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jun 11 15:18:25 PDT 2025


Author: Michael Maitland
Date: 2025-06-11T18:18:22-04:00
New Revision: 74172add65aa14e77e98b048db0074c3f273057f

URL: https://github.com/llvm/llvm-project/commit/74172add65aa14e77e98b048db0074c3f273057f
DIFF: https://github.com/llvm/llvm-project/commit/74172add65aa14e77e98b048db0074c3f273057f.diff

LOG: [mlir][generate-test-checks] Do not emit the autogenerated note if it exists (#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.

Co-authored-by: Michael Maitland <michaelmaitland at meta.com>

Added: 
    

Modified: 
    mlir/utils/generate-test-checks.py

Removed: 
    


################################################################################
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