This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Split the lit test spill-vgpr-to-agpr.ll to different tests
ClosedPublic

Authored by hsmhsm on Apr 18 2022, 7:21 PM.

Details

Summary

[1]. Move the test which reject the usage of agpr before gfx908 into a separate file - reject-agpr-usage-before-gfx908.ll.
[2]. Move those tests which are applicable to both gfx900 and gfx908 into a separate file - spill-vgpr.ll.
[3]. Keep those tests which are specific to only gfx908 in the file spill-vgpr-to-agpr.ll.

Above split is required to properly update the tests in D123525.

Diff Detail

Event Timeline

hsmhsm created this revision.Apr 18 2022, 7:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2022, 7:21 PM
Herald added subscribers: kerbowa, t-tye, tpr and 5 others. · View Herald Transcript
hsmhsm requested review of this revision.Apr 18 2022, 7:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2022, 7:21 PM
hsmhsm updated this revision to Diff 423509.Apr 18 2022, 7:47 PM

Usage of AGPR in reject-agpr-usage-before-gfx908.ll should also fail for gfx906.

hsmhsm updated this revision to Diff 423527.Apr 18 2022, 9:07 PM

Within spill-vgpr.ll, remove 2>&1 from RUN line for gfx900.

hsmhsm edited the summary of this revision. (Show Details)Apr 19 2022, 12:16 AM
hsmhsm edited the summary of this revision. (Show Details)Apr 19 2022, 12:18 AM

It does not seem to move tests but rather dropping them.

hsmhsm added a comment.EditedApr 19 2022, 7:41 PM

It does not seem to move tests but rather dropping them.

I cross-checked it again to verify if I have accidentally removed any tests - but it does not seem so, the changes reflect what I mentioned in the review message.

In detail - without this change - the file spill-vgpr-to-agpr.ll contains following functions which are tested against gfx900 ang gfx908.

[1]. @max_10_vgprs()
[2]. @max_10_vgprs_used_9a
[3]. @max_10_vgprs_used_1a_partial_spill
[4]. @max_10_vgprs_spill_v32
[5]. @max_256_vgprs_spill_9x32
[6]. @max_256_vgprs_spill_9x32_2bb
[7]. @stack_args_vgpr_spill

For gfx900, while testing @max_10_vgprs_used_9a and/or @max_10_vgprs_used_1a_partial_spill, the compilation fails because of a constraint. Remaining functions passes compilation for gfx900.
For gfx908, compilation passes for all 7 functions.

Now within this change - as discussed in the https://reviews.llvm.org/D123525, I have moved the check for error on agpr constraint in case of gfx900 to a new file - reject-agpr-usage-before-gfx908.ll

And with this, both @max_10_vgprs_used_9a and @max_10_vgprs_used_1a_partial_spill are really to be tested only against gfx908, and remaining 5 functions to be tested against both gf900 and gfx908.

Ans, I did so by keeping both @max_10_vgprs_used_9a and @max_10_vgprs_used_1a_partial_spill within the original file spill-vgpr-to-agpr.ll and testing it only against gfx908, and by moving all other 5 functions to a new file spill-vgpr.ll and testing all five of them against both gfx900 and gfx908.

Note that in the original file, we do few GCN checks for @max_10_vgprs_used_9a and @max_10_vgprs_used_1a_partial_spill against gfx900 even though the compilation fails (this is possible because of the quirk nature of llc which I explained in https://reviews.llvm.org/D123525), which are now got omitted since we now test these two functions only against gfx908. And, it actually does not make sense at all to test for assembly when the compilation itself fails, which is rather very confusing thing.

With this understanding, I am still not able to get - what test did I drop while doing the change as I mentioned above?

rampitec accepted this revision.Apr 20 2022, 12:16 PM

It does not seem to move tests but rather dropping them.

I cross-checked it again to verify if I have accidentally removed any tests - but it does not seem so, the changes reflect what I mentioned in the review message.

In detail - without this change - the file spill-vgpr-to-agpr.ll contains following functions which are tested against gfx900 ang gfx908.

[1]. @max_10_vgprs()
[2]. @max_10_vgprs_used_9a
[3]. @max_10_vgprs_used_1a_partial_spill
[4]. @max_10_vgprs_spill_v32
[5]. @max_256_vgprs_spill_9x32
[6]. @max_256_vgprs_spill_9x32_2bb
[7]. @stack_args_vgpr_spill

For gfx900, while testing @max_10_vgprs_used_9a and/or @max_10_vgprs_used_1a_partial_spill, the compilation fails because of a constraint. Remaining functions passes compilation for gfx900.
For gfx908, compilation passes for all 7 functions.

Now within this change - as discussed in the https://reviews.llvm.org/D123525, I have moved the check for error on agpr constraint in case of gfx900 to a new file - reject-agpr-usage-before-gfx908.ll

And with this, both @max_10_vgprs_used_9a and @max_10_vgprs_used_1a_partial_spill are really to be tested only against gfx908, and remaining 5 functions to be tested against both gf900 and gfx908.

Ans, I did so by keeping both @max_10_vgprs_used_9a and @max_10_vgprs_used_1a_partial_spill within the original file spill-vgpr-to-agpr.ll and testing it only against gfx908, and by moving all other 5 functions to a new file spill-vgpr.ll and testing all five of them against both gfx900 and gfx908.

Note that in the original file, we do few GCN checks for @max_10_vgprs_used_9a and @max_10_vgprs_used_1a_partial_spill against gfx900 even though the compilation fails (this is possible because of the quirk nature of llc which I explained in https://reviews.llvm.org/D123525), which are now got omitted since we now test these two functions only against gfx908. And, it actually does not make sense at all to test for assembly when the compilation itself fails, which is rather very confusing thing.

With this understanding, I am still not able to get - what test did I drop while doing the change as I mentioned above?

Ugh. You have copied the file! OK.

This revision is now accepted and ready to land.Apr 20 2022, 12:16 PM
This revision was landed with ongoing or failed builds.Apr 20 2022, 6:47 PM
This revision was automatically updated to reflect the committed changes.