Page MenuHomePhabricator

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

Authored by critson on Wed, Sep 16, 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.Wed, Sep 16, 1:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Sep 16, 1:19 AM
critson requested review of this revision.Wed, Sep 16, 1:19 AM
critson updated this revision to Diff 292458.Thu, Sep 17, 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.Thu, Sep 17, 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.Tue, Sep 22, 5:47 AM

Improve test.

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

This error should also be hit for gfx9

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

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.Wed, Sep 23, 5:48 AM
llvm/test/CodeGen/AMDGPU/verify-constant-bus-violations.mir
17

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