This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Consider all SGPR uses as unique in constant bus verify
ClosedPublic

Authored by critson on Sep 16 2020, 1:19 AM.

Details

Summary

Fix the verifier so that overlapping SGPR operands are counted
independently. We cannot assume that overlapping SGPR accesses
only count as a single constant bus use.
The exception is implicit uses which do not add to constant bus
usage (only) when overlapping.

Diff Detail

Event Timeline

critson created this revision.Sep 16 2020, 1:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2020, 1:19 AM
critson requested review of this revision.Sep 16 2020, 1:19 AM
critson updated this revision to Diff 292458.Sep 17 2020, 4:21 AM

Add basic test.

Needs test

I am not exactly sure kind of test is best for this?
I have added a XFAIL test which violates the modified verifier, but this is "expensive" in terms of time to failure.

arsenm added inline comments.Sep 17 2020, 6:20 AM
llvm/test/CodeGen/AMDGPU/constant-bus-violations.mir
1 ↗(On Diff #292458)

You can run with not --crash and check the error message, this shouldn't use xfail

15 ↗(On Diff #292458)

Add verify- to the test name?

critson updated this revision to Diff 293425.Sep 22 2020, 5:47 AM

Improve test.

This revision is now accepted and ready to land.Sep 22 2020, 9:43 AM
arsenm added inline comments.Sep 22 2020, 10:31 AM
llvm/test/CodeGen/AMDGPU/verify-constant-bus-violations.mir
16

This error should also be hit for gfx9

critson added inline comments.Sep 22 2020, 6:26 PM
llvm/test/CodeGen/AMDGPU/verify-constant-bus-violations.mir
16

It does, but compiler dies on first violation.
I can break this test into two files if you want me to check it?

arsenm added inline comments.Sep 23 2020, 5:48 AM
llvm/test/CodeGen/AMDGPU/verify-constant-bus-violations.mir
16

I forgot about that problem. It's probably not worth splitting it