This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Use workgroup fences in test waitcnt-vscnt.ll
AbandonedPublic

Authored by kerbowa on Feb 25 2022, 12:36 PM.

Details

Reviewers
foad
rampitec
Summary

The "singlethread" fences that were used in this test were not enforcing
adding any waitcnt. Use "workgroup" fences instead in preparation for
the addition of memory model/waitcnt optimizations.

NFC.

Diff Detail

Event Timeline

kerbowa created this revision.Feb 25 2022, 12:36 PM
kerbowa requested review of this revision.Feb 25 2022, 12:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2022, 12:36 PM

It does not seem to do what it did before. For example it used to test that only a vmcnt is produced or only a vscnt. Maybe duplicate these tests instead to create a _workgroup versions (like existing barrier_vmcnt_vscnt_flat_workgroup)?

It does not seem to do what it did before. For example it used to test that only a vmcnt is produced or only a vscnt. Maybe duplicate these tests instead to create a _workgroup versions (like existing barrier_vmcnt_vscnt_flat_workgroup)?

Yes, it doesn't test this anymore as it is until we optimize these fences which we will do soon. The problem is that the test was relying on the unique feature of barriers that will only insert the wait before if there are outstanding events of that type. With the child patch for "BackOffBarriers" feature, this doesn't work anymore. The "singlethread" fences should be removed regardless because they don't enforce any synchronization. So I don't think duplicating makes sense.

One option is to keep the tests as they were but to add -mattr=-back-off-barrier to the test.

Otherwise, we need another way to test that a waitcnt_vscnt is inserted only if there are outstanding events. We cannot use fences for this.

It does not seem to do what it did before. For example it used to test that only a vmcnt is produced or only a vscnt. Maybe duplicate these tests instead to create a _workgroup versions (like existing barrier_vmcnt_vscnt_flat_workgroup)?

Yes, it doesn't test this anymore as it is until we optimize these fences which we will do soon. The problem is that the test was relying on the unique feature of barriers that will only insert the wait before if there are outstanding events of that type. With the child patch for "BackOffBarriers" feature, this doesn't work anymore. The "singlethread" fences should be removed regardless because they don't enforce any synchronization. So I don't think duplicating makes sense.

One option is to keep the tests as they were but to add -mattr=-back-off-barrier to the test.

Otherwise, we need another way to test that a waitcnt_vscnt is inserted only if there are outstanding events. We cannot use fences for this.

The easiest way is to use -mattr I guess. I recall this test was useful to verify that only a needed set of waits is produced.

kerbowa abandoned this revision.Mar 3 2022, 10:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2022, 10:43 PM