<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59862>59862</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            update_test_checks incorrectly generates unused prefixes check
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm-tools
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          arichardson
      </td>
    </tr>
</table>

<pre>
    When using --check-globals update_test_checks.py can end up generating a spurious `NOTE: These prefixes are unused and the list is autogenerated.`

Consider the following input 

```llvm
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
; RUN: opt < %s -passes=vector-combine -S -mtriple=x86_64-- -mattr=sse2 | FileCheck %s --check-prefixes=CHECK,SSE2
; RUN: opt < %s -passes=vector-combine -S -mtriple=x86_64-- -mattr=avx2 | FileCheck %s --check-prefixes=CHECK,AVX2

define i1 @test(i1 %arg) {
  ret i1 %arg
}
```

The output ends up being
```llvm
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
; RUN: opt < %s -passes=vector-combine -S -mtriple=x86_64-- -mattr=sse2 | FileCheck %s --check-prefixes=CHECK,SSE2
; RUN: opt < %s -passes=vector-combine -S -mtriple=x86_64-- -mattr=avx2 | FileCheck %s --check-prefixes=CHECK,AVX2

define i1 @test(i1 %arg) {
; CHECK-LABEL: define {{[^@]+}}@test
; CHECK-SAME: (i1 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:    ret i1 [[ARG]]
;
  ret i1 %arg
}
;.
; SSE2: attributes #[[ATTR0]] = { "target-features"="+sse2" }
;.
; AVX2: attributes #[[ATTR0]] = { "target-features"="+avx2" }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; AVX2: {{.*}}
; SSE2: {{.*}}
```
The test still passes, but this note is incorrect.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