This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Remove integer division in VOPD checks
ClosedPublic

Authored by rampitec on Jun 10 2023, 1:26 AM.

Details

Summary

There is no way any compiler can simplify this division, while
the check is done rather often.

Diff Detail

Event Timeline

rampitec created this revision.Jun 10 2023, 1:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2023, 1:26 AM
rampitec requested review of this revision.Jun 10 2023, 1:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2023, 1:26 AM
Herald added a subscriber: wdng. · View Herald Transcript

NB: To have a chance to simplify division here a compiler must fully unroll the loop. With the loop growing it becomes impossible.

rampitec added inline comments.Jun 10 2023, 1:56 AM
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
564

On a separate note, I do not understand 2 banks for the src2. This should have been checked yet while checking vdst parity. If there is a real src2 it must follow a regular rules for the source banks. At the moment this is simply misleading, the loop will actually exit at the first iteration if the parity is the same. It is a time bomb, but this is a separate patch.

rampitec added inline comments.
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
564

In fact this is already broken: D152614. Our own tests verify this is broken and must be broken. Insane.

I am growing to think that update_*_test_checks scripts are a simulation of testing. Nobody seems to really think what tests are doing now.

rampitec added inline comments.Jun 10 2023, 3:47 PM
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
564

Please ignore the src2 part, just found an additional restriction.

This revision is now accepted and ready to land.Jun 12 2023, 2:45 PM
This revision was automatically updated to reflect the committed changes.