[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added a comment.

In D93078#2500124 , @jdoerfert wrote:

> In D93078#2500122 , @mtrofin wrote:
>
>> In D93078#2500114 , @jdoerfert 
>> wrote:
>>
>>> In D93078#2500040 , @mtrofin wrote:
>>>
 In D93078#2500032 , @jdoerfert 
 wrote:

> In D93078#246 , @mtrofin 
> wrote:
>
>> In D93078#245 , @jdoerfert 
>> wrote:
>>
>>> I'm not sure how this is more helpful. What is the use case where this 
>>> way of warning helps?
>>
>> For tests other than attributor, that explicitly set FileCheck 
>> --allow-unused-prefixes=true, these warnings mean that there will be 
>> unused prefixes (those listed)
>
> Should not we check for that flag in the RUN line then and only warn for 
> unused prefixes when it is set. If there is no prefix we should obviously 
> always warn.

 That's a good idea. Probably we'd need to also make sure that the unused 
 prefixes are all on RUN lines with --allow-unused-prefixes=true.

 I'm also not sure how lit.local.cfg interacts with the test prefix 
 updater: currently, the only cases where we bulk-want to allow unused 
 prefixes is the Attributor tests. If you were going to add the flag 
 explicitly, that'd also work. Or just the option to the update_test_prefix 
 that says "ok with duplicates, don't warn"
>>>
>>> I can add the option explicitly (D94744 ). 
>>> We should look for the filecheck one if possible, two options means double 
>>> the hassle. That said, why are we warning in both FileCheck and 
>>> update_test_check, it seems to be unnecessary to do the latter.
>>
>> update_test_prefix.py's role is temporary: once we flip FileCheck to 
>> disallow unused prefixes by default, we don't need to keep it around. At 
>> that point, it becomes important for the update__test_check scripts to 
>> warn.
>
> I don't follow. I would assume it's the opposite. If FileCheck doesn't allow 
> unused prefixes why warn in the update script as well. Anyway, there should 
> be a way to opt-out.



In D93078#2500124 , @jdoerfert wrote:

> In D93078#2500122 , @mtrofin wrote:
>
>> In D93078#2500114 , @jdoerfert 
>> wrote:
>>
>>> In D93078#2500040 , @mtrofin wrote:
>>>
 In D93078#2500032 , @jdoerfert 
 wrote:

> In D93078#246 , @mtrofin 
> wrote:
>
>> In D93078#245 , @jdoerfert 
>> wrote:
>>
>>> I'm not sure how this is more helpful. What is the use case where this 
>>> way of warning helps?
>>
>> For tests other than attributor, that explicitly set FileCheck 
>> --allow-unused-prefixes=true, these warnings mean that there will be 
>> unused prefixes (those listed)
>
> Should not we check for that flag in the RUN line then and only warn for 
> unused prefixes when it is set. If there is no prefix we should obviously 
> always warn.

 That's a good idea. Probably we'd need to also make sure that the unused 
 prefixes are all on RUN lines with --allow-unused-prefixes=true.

 I'm also not sure how lit.local.cfg interacts with the test prefix 
 updater: currently, the only cases where we bulk-want to allow unused 
 prefixes is the Attributor tests. If you were going to add the flag 
 explicitly, that'd also work. Or just the option to the update_test_prefix 
 that says "ok with duplicates, don't warn"
>>>
>>> I can add the option explicitly (D94744 ). 
>>> We should look for the filecheck one if possible, two options means double 
>>> the hassle. That said, why are we warning in both FileCheck and 
>>> update_test_check, it seems to be unnecessary to do the latter.
>>
>> update_test_prefix.py's role is temporary: once we flip FileCheck to 
>> disallow unused prefixes by default, we don't need to keep it around. At 
>> that point, it becomes important for the update__test_check scripts to 
>> warn.
>
> I don't follow. I would assume it's the opposite. If FileCheck doesn't allow 
> unused prefixes why warn in the update script as well. Anyway, there should 
> be a way to opt-out.

There's an earlier comment in this patch about that, anchored to line 296 of 
common.py. IIUC, a developer: 1) updates their test by adding new RUN lines, 
maybe adding prefixes to existing RUN lines, 2) runs the appropriate 
update_xyz_checks.py. Then, indeed, they 

[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In D93078#2500122 , @mtrofin wrote:

> In D93078#2500114 , @jdoerfert wrote:
>
>> In D93078#2500040 , @mtrofin wrote:
>>
>>> In D93078#2500032 , @jdoerfert 
>>> wrote:
>>>
 In D93078#246 , @mtrofin 
 wrote:

> In D93078#245 , @jdoerfert 
> wrote:
>
>> I'm not sure how this is more helpful. What is the use case where this 
>> way of warning helps?
>
> For tests other than attributor, that explicitly set FileCheck 
> --allow-unused-prefixes=true, these warnings mean that there will be 
> unused prefixes (those listed)

 Should not we check for that flag in the RUN line then and only warn for 
 unused prefixes when it is set. If there is no prefix we should obviously 
 always warn.
>>>
>>> That's a good idea. Probably we'd need to also make sure that the unused 
>>> prefixes are all on RUN lines with --allow-unused-prefixes=true.
>>>
>>> I'm also not sure how lit.local.cfg interacts with the test prefix updater: 
>>> currently, the only cases where we bulk-want to allow unused prefixes is 
>>> the Attributor tests. If you were going to add the flag explicitly, that'd 
>>> also work. Or just the option to the update_test_prefix that says "ok with 
>>> duplicates, don't warn"
>>
>> I can add the option explicitly (D94744 ). 
>> We should look for the filecheck one if possible, two options means double 
>> the hassle. That said, why are we warning in both FileCheck and 
>> update_test_check, it seems to be unnecessary to do the latter.
>
> update_test_prefix.py's role is temporary: once we flip FileCheck to disallow 
> unused prefixes by default, we don't need to keep it around. At that point, 
> it becomes important for the update__test_check scripts to warn.

I don't follow. I would assume it's the opposite. If FileCheck doesn't allow 
unused prefixes why warn in the update script as well. Anyway, there should be 
a way to opt-out.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added a comment.

In D93078#2500114 , @jdoerfert wrote:

> In D93078#2500040 , @mtrofin wrote:
>
>> In D93078#2500032 , @jdoerfert 
>> wrote:
>>
>>> In D93078#246 , @mtrofin wrote:
>>>
 In D93078#245 , @jdoerfert 
 wrote:

> I'm not sure how this is more helpful. What is the use case where this 
> way of warning helps?

 For tests other than attributor, that explicitly set FileCheck 
 --allow-unused-prefixes=true, these warnings mean that there will be 
 unused prefixes (those listed)
>>>
>>> Should not we check for that flag in the RUN line then and only warn for 
>>> unused prefixes when it is set. If there is no prefix we should obviously 
>>> always warn.
>>
>> That's a good idea. Probably we'd need to also make sure that the unused 
>> prefixes are all on RUN lines with --allow-unused-prefixes=true.
>>
>> I'm also not sure how lit.local.cfg interacts with the test prefix updater: 
>> currently, the only cases where we bulk-want to allow unused prefixes is the 
>> Attributor tests. If you were going to add the flag explicitly, that'd also 
>> work. Or just the option to the update_test_prefix that says "ok with 
>> duplicates, don't warn"
>
> I can add the option explicitly (D94744 ). 
> We should look for the filecheck one if possible, two options means double 
> the hassle. That said, why are we warning in both FileCheck and 
> update_test_check, it seems to be unnecessary to do the latter.

update_test_prefix.py's role is temporary: once we flip FileCheck to disallow 
unused prefixes by default, we don't need to keep it around. At that point, it 
becomes important for the update__test_check scripts to warn.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In D93078#2500040 , @mtrofin wrote:

> In D93078#2500032 , @jdoerfert wrote:
>
>> In D93078#246 , @mtrofin wrote:
>>
>>> In D93078#245 , @jdoerfert 
>>> wrote:
>>>
 I'm not sure how this is more helpful. What is the use case where this way 
 of warning helps?
>>>
>>> For tests other than attributor, that explicitly set FileCheck 
>>> --allow-unused-prefixes=true, these warnings mean that there will be unused 
>>> prefixes (those listed)
>>
>> Should not we check for that flag in the RUN line then and only warn for 
>> unused prefixes when it is set. If there is no prefix we should obviously 
>> always warn.
>
> That's a good idea. Probably we'd need to also make sure that the unused 
> prefixes are all on RUN lines with --allow-unused-prefixes=true.
>
> I'm also not sure how lit.local.cfg interacts with the test prefix updater: 
> currently, the only cases where we bulk-want to allow unused prefixes is the 
> Attributor tests. If you were going to add the flag explicitly, that'd also 
> work. Or just the option to the update_test_prefix that says "ok with 
> duplicates, don't warn"

I can add the option explicitly (D94744 ). We 
should look for the filecheck one if possible, two options means double the 
hassle. That said, why are we warning in both FileCheck and update_test_check, 
it seems to be unnecessary to do the latter.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added a comment.

In D93078#2500032 , @jdoerfert wrote:

> In D93078#246 , @mtrofin wrote:
>
>> In D93078#245 , @jdoerfert 
>> wrote:
>>
>>> In D93078#2499982 , @mtrofin wrote:
>>>
 In D93078#2499666 , @jdoerfert 
 wrote:

> I think this caused a lot of problems for the Attributor tests. I get the 
> "conflict output" warning all the time now :(
>
> These two `UpdateTestChecks` tests also generate the warning. I would 
> think that they haven't before.
>
>   LLVM :: tools/UpdateTestChecks/update_test_checks/check_attrs.test
>   LLVM :: 
> tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
>
> I suspect the `--check-attributes` flag effect are not taken into account 
> somewhere but I might be wrong.

 The warnings are correct, but their purpose is to inform. For example, 
 take check_attrs. The third and fourth opt run produce different function 
 attributes from those produced by the first two, so the function is 
 different insofar as update_test_prefix is concerned. The warnings are 
 there to indicate that the listed prefixes end up not being used. But, 
 that's 'by design' for the attributor tests, IIRC.

 If the warnings are noise for you, we could add a flag to quiet them down, 
 which you'd flip when regenerating attributor tests?
>>>
>>> TBH, before, the warnings meant there is a problem that needs fixing. Now 
>>> they mean, there might be one or not. So, depending on your setup it's just 
>>> noise while it was pure signal before.
>>> I'm not sure how this is more helpful. What is the use case where this way 
>>> of warning helps?
>>
>> For tests other than attributor, that explicitly set FileCheck 
>> --allow-unused-prefixes=true, these warnings mean that there will be unused 
>> prefixes (those listed)
>
> Should not we check for that flag in the RUN line then and only warn for 
> unused prefixes when it is set. If there is no prefix we should obviously 
> always warn.

That's a good idea. Probably we'd need to also make sure that the unused 
prefixes are all on RUN lines with --allow-unused-prefixes=true.

I'm also not sure how lit.local.cfg interacts with the test prefix updater: 
currently, the only cases where we bulk-want to allow unused prefixes is the 
Attributor tests. If you were going to add the flag explicitly, that'd also 
work. Or just the option to the update_test_prefix that says "ok with 
duplicates, don't warn"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In D93078#246 , @mtrofin wrote:

> In D93078#245 , @jdoerfert wrote:
>
>> In D93078#2499982 , @mtrofin wrote:
>>
>>> In D93078#2499666 , @jdoerfert 
>>> wrote:
>>>
 I think this caused a lot of problems for the Attributor tests. I get the 
 "conflict output" warning all the time now :(

 These two `UpdateTestChecks` tests also generate the warning. I would 
 think that they haven't before.

   LLVM :: tools/UpdateTestChecks/update_test_checks/check_attrs.test
   LLVM :: 
 tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test

 I suspect the `--check-attributes` flag effect are not taken into account 
 somewhere but I might be wrong.
>>>
>>> The warnings are correct, but their purpose is to inform. For example, take 
>>> check_attrs. The third and fourth opt run produce different function 
>>> attributes from those produced by the first two, so the function is 
>>> different insofar as update_test_prefix is concerned. The warnings are 
>>> there to indicate that the listed prefixes end up not being used. But, 
>>> that's 'by design' for the attributor tests, IIRC.
>>>
>>> If the warnings are noise for you, we could add a flag to quiet them down, 
>>> which you'd flip when regenerating attributor tests?
>>
>> TBH, before, the warnings meant there is a problem that needs fixing. Now 
>> they mean, there might be one or not. So, depending on your setup it's just 
>> noise while it was pure signal before.
>> I'm not sure how this is more helpful. What is the use case where this way 
>> of warning helps?
>
> For tests other than attributor, that explicitly set FileCheck 
> --allow-unused-prefixes=true, these warnings mean that there will be unused 
> prefixes (those listed)

Should not we check for that flag in the RUN line then and only warn for unused 
prefixes when it is set. If there is no prefix we should obviously always warn.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added a comment.

In D93078#245 , @jdoerfert wrote:

> In D93078#2499982 , @mtrofin wrote:
>
>> In D93078#2499666 , @jdoerfert 
>> wrote:
>>
>>> I think this caused a lot of problems for the Attributor tests. I get the 
>>> "conflict output" warning all the time now :(
>>>
>>> These two `UpdateTestChecks` tests also generate the warning. I would think 
>>> that they haven't before.
>>>
>>>   LLVM :: tools/UpdateTestChecks/update_test_checks/check_attrs.test
>>>   LLVM :: 
>>> tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
>>>
>>> I suspect the `--check-attributes` flag effect are not taken into account 
>>> somewhere but I might be wrong.
>>
>> The warnings are correct, but their purpose is to inform. For example, take 
>> check_attrs. The third and fourth opt run produce different function 
>> attributes from those produced by the first two, so the function is 
>> different insofar as update_test_prefix is concerned. The warnings are there 
>> to indicate that the listed prefixes end up not being used. But, that's 'by 
>> design' for the attributor tests, IIRC.
>>
>> If the warnings are noise for you, we could add a flag to quiet them down, 
>> which you'd flip when regenerating attributor tests?
>
> TBH, before, the warnings meant there is a problem that needs fixing. Now 
> they mean, there might be one or not. So, depending on your setup it's just 
> noise while it was pure signal before.
> I'm not sure how this is more helpful. What is the use case where this way of 
> warning helps?

For tests other than attributor, that explicitly set FileCheck 
--allow-unused-prefixes=true, these warnings mean that there will be unused 
prefixes (those listed)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In D93078#2499982 , @mtrofin wrote:

> In D93078#2499666 , @jdoerfert wrote:
>
>> I think this caused a lot of problems for the Attributor tests. I get the 
>> "conflict output" warning all the time now :(
>>
>> These two `UpdateTestChecks` tests also generate the warning. I would think 
>> that they haven't before.
>>
>>   LLVM :: tools/UpdateTestChecks/update_test_checks/check_attrs.test
>>   LLVM :: tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
>>
>> I suspect the `--check-attributes` flag effect are not taken into account 
>> somewhere but I might be wrong.
>
> The warnings are correct, but their purpose is to inform. For example, take 
> check_attrs. The third and fourth opt run produce different function 
> attributes from those produced by the first two, so the function is different 
> insofar as update_test_prefix is concerned. The warnings are there to 
> indicate that the listed prefixes end up not being used. But, that's 'by 
> design' for the attributor tests, IIRC.
>
> If the warnings are noise for you, we could add a flag to quiet them down, 
> which you'd flip when regenerating attributor tests?

TBH, before, the warnings meant there is a problem that needs fixing. Now they 
mean, there might be one or not. So, depending on your setup it's just noise 
while it was pure signal before.
I'm not sure how this is more helpful. What is the use case where this way of 
warning helps?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added a comment.

In D93078#2499666 , @jdoerfert wrote:

> I think this caused a lot of problems for the Attributor tests. I get the 
> "conflict output" warning all the time now :(
>
> These two `UpdateTestChecks` tests also generate the warning. I would think 
> that they haven't before.
>
>   LLVM :: tools/UpdateTestChecks/update_test_checks/check_attrs.test
>   LLVM :: tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
>
> I suspect the `--check-attributes` flag effect are not taken into account 
> somewhere but I might be wrong.

The warnings are correct, but their purpose is to inform. For example, take 
check_attrs. The third and fourth opt run produce different function attributes 
from those produced by the first two, so the function is different insofar as 
update_test_prefix is concerned. The warnings are there to indicate that the 
listed prefixes end up not being used. But, that's 'by design' for the 
attributor tests, IIRC.

If the warnings are noise for you, we could add a flag to quiet them down, 
which you'd flip when regenerating attributor tests?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2021-01-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert reopened this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

I think this caused a lot of problems for the Attributor tests. I get the 
"conflict output" warning all the time now :(

These two `UpdateTestChecks` tests also generate the warning. I would think 
that they haven't before.

  LLVM :: tools/UpdateTestChecks/update_test_checks/check_attrs.test
  LLVM :: tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test

I suspect the `--check-attributes` flag effect are not taken into account 
somewhere but I might be wrong.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-15 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments.



Comment at: llvm/utils/update_analyze_test_checks.py:129
+
+common.warn_on_failed_prefixes(func_dict)
 is_in_function = False

mtrofin wrote:
> pengfei wrote:
> > Can we move these warn to common.py?
> Come to think of it, maybe moving it to common.py was not quite ideal:
> - once a warning is issued in the middle of the list of RUN lines, it'll just 
> be re-issued next time around; we could warn and exit, but that'd be annoying 
> if there's another failure later in the RUN list.
> - if we do it at the end, we can additionally distinguish the case where a 
> prefix has an empty dict of funcs associated with it -> and the warning would 
> be "there are unused prefixes - please remove %s'. This is more discoverable 
> than llvm-lit -a, and also than relying on the user knowing to run 
> uplate_test_prefix.
> 
> I think that the benefits (discoverability, better, more concise warnings) 
> make the extra 2-3 lines worth it; and we already have tests for these other 
> tools - wdyt?
Make sence for me. Thanks for continuing to improve it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-15 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added inline comments.



Comment at: llvm/utils/update_analyze_test_checks.py:129
+
+common.warn_on_failed_prefixes(func_dict)
 is_in_function = False

pengfei wrote:
> Can we move these warn to common.py?
Come to think of it, maybe moving it to common.py was not quite ideal:
- once a warning is issued in the middle of the list of RUN lines, it'll just 
be re-issued next time around; we could warn and exit, but that'd be annoying 
if there's another failure later in the RUN list.
- if we do it at the end, we can additionally distinguish the case where a 
prefix has an empty dict of funcs associated with it -> and the warning would 
be "there are unused prefixes - please remove %s'. This is more discoverable 
than llvm-lit -a, and also than relying on the user knowing to run 
uplate_test_prefix.

I think that the benefits (discoverability, better, more concise warnings) make 
the extra 2-3 lines worth it; and we already have tests for these other tools - 
wdyt?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-15 Thread Mircea Trofin via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe2dc306b1ac7: [utils] Fix UpdateTestChecks case where 2 runs 
differ for last label (authored by mtrofin).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

Files:
  clang/test/utils/update_cc_test_checks/Inputs/prefix-never-matches.cpp
  clang/test/utils/update_cc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-1.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-2.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-3.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
  llvm/test/tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/update_test_prefix.py

Index: llvm/utils/update_test_prefix.py
===
--- llvm/utils/update_test_prefix.py
+++ llvm/utils/update_test_prefix.py
@@ -31,7 +31,7 @@
 t = re.search('Assertions have been autogenerated by (.*)', s)
 if t:
 s = os.popen('llvm/' + t.group(1) + ' ' + i + ' 2>&1').read()
-if 'Found conflicting' in s:
+if 'had conflicting output from different RUN lines for all functions' in s:
 return -1
 s = os.popen('git diff ' + i).read()
 if re.search('\n(?:-+)\n', s) or re.search('\n[+-].*(?&1 | FileCheck %s
+# RUN: FileCheck --input-file=%t.ll %s --check-prefix=OUTPUT
+
+# CHECK: WARNING: Prefix A had conflicting output
+# OUTPUT-NOT: A:
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
@@ -0,0 +1,7 @@
+; RUN: opt -O0 -S < %s  | FileCheck %s -check-prefix=A
+; RUN: opt -O3 -S < %s  | FileCheck %s -check-prefix=A
+
+define i32 @foo(i32 %i) {
+%r = add i32 1, 1
+ret i32 %r
+}
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
@@ -0,0 +1,8 @@
+# REQUIRES: x86-registered-target
+
+# RUN: cp -f %S/Inputs/prefix-never-matches.ll %t.ll
+# RUN: %update_llc_test_checks %t.ll 2>&1 | FileCheck %s
+# RUN: FileCheck --input-file=%t.ll %s --check-prefix=OUTPUT
+
+# CHECK: WARNING: Prefix A had conflicting output
+# OUTPUT-NOT: A:
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
@@ -0,0 +1,14 @@
+# REQUIRES: x86-registered-target
+
+# RUN: cp -f %S/Inputs/common-label-different-bodies-1.ll %t-1.ll
+# RUN: cp -f %S/Inputs/common-label-different-bodies-2.ll %t-2.ll
+# RUN: cp -f %S/Inputs/common-label-different-bodies-3.ll %t-3.ll
+# RUN: %update_llc_test_checks %t-1.ll
+# RUN: %update_llc_test_checks %t-2.ll
+# RUN: %update_llc_test_checks %t-3.ll
+# RUN: FileCheck --input-file=%t-1.ll %s
+# RUN: FileCheck --input-file=%t-2.ll %s
+# RUN: FileCheck --input-file=%t-3.ll %s
+
+# CHECK: B-LABEL: fold_v2i64
+# CHECK-NOT: A-LABEL: fold_v2i64
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
@@ -0,0 +1,10 @@
+; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=A
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefixes=A
+
+declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
+
+define <2 x i64> @fold_v2i64() {
+entry:
+  %r = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> )
+  ret <2 x i64> %r
+}
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-3.ll
===
--- /dev/null
+++ 

[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-15 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin updated this revision to Diff 311896.
mtrofin added a comment.

update_test_prefix.py change


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

Files:
  clang/test/utils/update_cc_test_checks/Inputs/prefix-never-matches.cpp
  clang/test/utils/update_cc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-1.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-2.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-3.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
  llvm/test/tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/update_test_prefix.py

Index: llvm/utils/update_test_prefix.py
===
--- llvm/utils/update_test_prefix.py
+++ llvm/utils/update_test_prefix.py
@@ -31,7 +31,7 @@
 t = re.search('Assertions have been autogenerated by (.*)', s)
 if t:
 s = os.popen('llvm/' + t.group(1) + ' ' + i + ' 2>&1').read()
-if 'Found conflicting' in s:
+if 'had conflicting output from different RUN lines for all functions' in s:
 return -1
 s = os.popen('git diff ' + i).read()
 if re.search('\n(?:-+)\n', s) or re.search('\n[+-].*(?&1 | FileCheck %s
+# RUN: FileCheck --input-file=%t.ll %s --check-prefix=OUTPUT
+
+# CHECK: WARNING: Prefix A had conflicting output
+# OUTPUT-NOT: A:
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
@@ -0,0 +1,7 @@
+; RUN: opt -O0 -S < %s  | FileCheck %s -check-prefix=A
+; RUN: opt -O3 -S < %s  | FileCheck %s -check-prefix=A
+
+define i32 @foo(i32 %i) {
+%r = add i32 1, 1
+ret i32 %r
+}
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
@@ -0,0 +1,8 @@
+# REQUIRES: x86-registered-target
+
+# RUN: cp -f %S/Inputs/prefix-never-matches.ll %t.ll
+# RUN: %update_llc_test_checks %t.ll 2>&1 | FileCheck %s
+# RUN: FileCheck --input-file=%t.ll %s --check-prefix=OUTPUT
+
+# CHECK: WARNING: Prefix A had conflicting output
+# OUTPUT-NOT: A:
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
@@ -0,0 +1,14 @@
+# REQUIRES: x86-registered-target
+
+# RUN: cp -f %S/Inputs/common-label-different-bodies-1.ll %t-1.ll
+# RUN: cp -f %S/Inputs/common-label-different-bodies-2.ll %t-2.ll
+# RUN: cp -f %S/Inputs/common-label-different-bodies-3.ll %t-3.ll
+# RUN: %update_llc_test_checks %t-1.ll
+# RUN: %update_llc_test_checks %t-2.ll
+# RUN: %update_llc_test_checks %t-3.ll
+# RUN: FileCheck --input-file=%t-1.ll %s
+# RUN: FileCheck --input-file=%t-2.ll %s
+# RUN: FileCheck --input-file=%t-3.ll %s
+
+# CHECK: B-LABEL: fold_v2i64
+# CHECK-NOT: A-LABEL: fold_v2i64
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
@@ -0,0 +1,10 @@
+; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=A
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefixes=A
+
+declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
+
+define <2 x i64> @fold_v2i64() {
+entry:
+  %r = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> )
+  ret <2 x i64> %r
+}
Index: llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-3.ll
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-3.ll
@@ -0,0 +1,11 @@
+; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=A,B

[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-15 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added a comment.

In D93078#2453891 , @pengfei wrote:

> LGTM. Thanks.
> `update_test_prefix.py` assumes the conflicting output. You may need to 
> change the expection of it as well.

oh yes - made it check the new warning. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision.
pengfei added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.
`update_test_prefix.py` assumes the conflicting output. You may need to change 
the expection of it as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin added a comment.

cleanup


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin updated this revision to Diff 311593.
mtrofin marked 3 inline comments as done.
mtrofin added a comment.

fix


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

Files:
  clang/test/utils/update_cc_test_checks/Inputs/prefix-never-matches.cpp
  clang/test/utils/update_cc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-1.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-2.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-3.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
  llvm/test/tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
  llvm/utils/UpdateTestChecks/common.py

Index: llvm/utils/UpdateTestChecks/common.py
===
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -258,6 +258,20 @@
   def __str__(self):
 return self.scrub
 
+def get_failed_prefixes(func_dict):
+  # This returns the list of those prefixes that failed to match any function,
+  # because there were conflicting bodies produced by different RUN lines, in
+  # all instances of the prefix. Effectivelly, this prefix is unused and should
+  # be removed.
+  for prefix in func_dict:
+if (not [fct for fct in func_dict[prefix] 
+ if func_dict[prefix][fct] is not None]):
+  yield prefix
+
+def warn_on_failed_prefixes(func_dict):
+  for prefix in get_failed_prefixes(func_dict):
+  warn('Prefix %s had conflicting output from different RUN lines for all functions' % (prefix,))
+
 def build_function_body_dictionary(function_re, scrubber, scrubber_args, raw_tool_output, prefixes, func_dict, func_order, verbose, record_args, check_attributes):
   for m in function_re.finditer(raw_tool_output):
 if not m:
@@ -287,20 +301,28 @@
 print('  ' + l, file=sys.stderr)
 for prefix in prefixes:
   if func in func_dict[prefix]:
-if str(func_dict[prefix][func]) != scrubbed_body or (func_dict[prefix][func] and (func_dict[prefix][func].args_and_sig != args_and_sig or func_dict[prefix][func].attrs != attrs)):
-  if func_dict[prefix][func] and func_dict[prefix][func].is_same_except_arg_names(scrubbed_extra, args_and_sig, attrs):
+if (func_dict[prefix][func] is None or
+str(func_dict[prefix][func]) != scrubbed_body or
+func_dict[prefix][func].args_and_sig != args_and_sig or
+func_dict[prefix][func].attrs != attrs):
+  if (func_dict[prefix][func] is not None and
+  func_dict[prefix][func].is_same_except_arg_names(scrubbed_extra,
+   args_and_sig,
+   attrs)):
 func_dict[prefix][func].scrub = scrubbed_extra
 func_dict[prefix][func].args_and_sig = args_and_sig
 continue
   else:
-if prefix == prefixes[-1]:
-  warn('Found conflicting asm under the same prefix: %r!' % (prefix,))
-else:
-  func_dict[prefix][func] = None
-  continue
+# This means a previous RUN line produced a body for this function
+# that is different from the one produced by this current RUN line,
+# so the body can't be common accross RUN lines. We use None to
+# indicate that.
+func_dict[prefix][func] = None
+continue
 
   func_dict[prefix][func] = function_body(scrubbed_body, scrubbed_extra, args_and_sig, attrs)
   func_order[prefix].append(func)
+  warn_on_failed_prefixes(func_dict)
 
 # Generator of LLVM IR CHECK lines
 
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
===
--- /dev/null
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
@@ -0,0 +1,6 @@
+# RUN: cp -f %S/Inputs/prefix-never-matches.ll %t.ll
+# RUN: %update_test_checks %t.ll 2>&1 | FileCheck %s
+# RUN: FileCheck --input-file=%t.ll %s --check-prefix=OUTPUT
+
+# CHECK: WARNING: Prefix A had conflicting output
+# OUTPUT-NOT: A:
\ No newline at end of file
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
===
--- /dev/null
+++ 

[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-14 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin marked an inline comment as done.
mtrofin added a comment.

In D93078#2451747 , @pengfei wrote:

> What's the difference with the existing code? It looks to me that you just 
> brought the warning out of loop, right?

Oh true! we can just do the check in build_function_body_dictionary_for_triple 
at the end.

I'll leave the additional tests, though, more tests never hurt.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment.

What's the difference with the existing code? It looks to me that you just 
brought the warning out of loop, right?




Comment at: llvm/utils/update_analyze_test_checks.py:128
   raw_tool_output, prefixes, func_dict, func_order, args.verbose, 
False, False)
-
+
+common.warn_on_failed_prefixes(func_dict)

redundant space.



Comment at: llvm/utils/update_analyze_test_checks.py:129
+
+common.warn_on_failed_prefixes(func_dict)
 is_in_function = False

Can we move these warn to common.py?



Comment at: llvm/utils/update_cc_test_checks.py:269
 line2spell_and_mangled_list[k].append(v)
-
+
+common.warn_on_failed_prefixes(func_dict)

redundant space.



Comment at: llvm/utils/update_test_checks.py:120
   ti.args.function_signature, ti.args.check_attributes)
-
+
+common.warn_on_failed_prefixes(func_dict)

redundant space.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93078: [utils] Fix UpdateTestChecks case where 2 runs differ for last label

2020-12-11 Thread Mircea Trofin via Phabricator via cfe-commits
mtrofin updated this revision to Diff 311359.
mtrofin marked an inline comment as done.
mtrofin added a comment.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

added check for when a prefix has conflicts for all functions


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93078/new/

https://reviews.llvm.org/D93078

Files:
  clang/test/utils/update_cc_test_checks/Inputs/prefix-never-matches.cpp
  clang/test/utils/update_cc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-1.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-2.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/common-label-different-bodies-3.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/prefix-never-matches.ll
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/common-label-different-bodies.test
  
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/prefix-never-matches.test
  
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/prefix-never-matches.ll
  llvm/test/tools/UpdateTestChecks/update_test_checks/prefix-never-matches.test
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/update_analyze_test_checks.py
  llvm/utils/update_cc_test_checks.py
  llvm/utils/update_llc_test_checks.py
  llvm/utils/update_test_checks.py

Index: llvm/utils/update_test_checks.py
===
--- llvm/utils/update_test_checks.py
+++ llvm/utils/update_test_checks.py
@@ -117,7 +117,8 @@
   common.OPT_FUNCTION_RE, common.scrub_body, [],
   raw_tool_output, prefixes, func_dict, func_order, ti.args.verbose,
   ti.args.function_signature, ti.args.check_attributes)
-
+
+common.warn_on_failed_prefixes(func_dict)
 is_in_function = False
 is_in_function_start = False
 prefix_set = set([prefix for prefixes, _ in prefix_list for prefix in prefixes])
Index: llvm/utils/update_llc_test_checks.py
===
--- llvm/utils/update_llc_test_checks.py
+++ llvm/utils/update_llc_test_checks.py
@@ -118,6 +118,8 @@
   asm.build_function_body_dictionary_for_triple(ti.args, raw_tool_output,
   triple, prefixes, func_dict, func_order)
 
+common.warn_on_failed_prefixes(func_dict)
+
 is_in_function = False
 is_in_function_start = False
 func_name = None
Index: llvm/utils/update_cc_test_checks.py
===
--- llvm/utils/update_cc_test_checks.py
+++ llvm/utils/update_cc_test_checks.py
@@ -266,7 +266,8 @@
   # mangled names. Forward all clang args for now.
   for k, v in get_line2spell_and_mangled(ti.args, clang_args).items():
 line2spell_and_mangled_list[k].append(v)
-
+
+common.warn_on_failed_prefixes(func_dict)
 global_vars_seen_dict = {}
 prefix_set = set([prefix for p in run_list for prefix in p[0]])
 output_lines = []
Index: llvm/utils/update_analyze_test_checks.py
===
--- llvm/utils/update_analyze_test_checks.py
+++ llvm/utils/update_analyze_test_checks.py
@@ -125,7 +125,8 @@
 common.build_function_body_dictionary(
   common.ANALYZE_FUNCTION_RE, common.scrub_body, [],
   raw_tool_output, prefixes, func_dict, func_order, args.verbose, False, False)
-
+
+common.warn_on_failed_prefixes(func_dict)
 is_in_function = False
 is_in_function_start = False
 prefix_set = set([prefix for prefixes, _ in prefix_list for prefix in prefixes])
Index: llvm/utils/UpdateTestChecks/common.py
===
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -258,6 +258,20 @@
   def __str__(self):
 return self.scrub
 
+def get_failed_prefixes(func_dict):
+  # This returns the list of those prefixes that failed to match any function,
+  # because there were conflicting bodies produced by different RUN lines, in
+  # all instances of the prefix. Effectivelly, this prefix is unused and should
+  # be removed.
+  for prefix in func_dict:
+if (not [fct for fct in func_dict[prefix] 
+ if func_dict[prefix][fct] is not None]):
+  yield prefix
+
+def warn_on_failed_prefixes(func_dict):
+  for prefix in get_failed_prefixes(func_dict):
+  warn('Prefix %s had conflicting output from different RUN lines for all functions' % (prefix,))
+
 def build_function_body_dictionary(function_re, scrubber, scrubber_args, raw_tool_output, prefixes, func_dict, func_order, verbose, record_args, check_attributes):
   for m in function_re.finditer(raw_tool_output):
 if not m:
@@ -287,17 +301,24 @@
 print('  ' + l, file=sys.stderr)
 for prefix in prefixes: