This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix 64 bit DPP validation
ClosedPublic

Authored by rampitec on May 5 2021, 11:38 AM.

Details

Summary

AMDGPUAsmParser::isSupportedDPPCtrl() was failing to correctly
find a DPP register operand, regadless of the position it is
always src0. Moved this check into a new validateDPP() method
where we have full instruction already. In particular it was
failing to reject this case:

v_cvt_u32_f64 v5, v[0:1] quad_perm:[0,2,1,1] row_mask:0xf bank_mask:0xf

Essentially it was broken for any case where size of dst and
src0 differ.

It also improves the diagnostics with a proper error message.

The check in the InstPrinter also drops verification of the dst
register as it does not have anything to do with the dpp operand.

Diff Detail

Event Timeline

rampitec created this revision.May 5 2021, 11:38 AM
rampitec requested review of this revision.May 5 2021, 11:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2021, 11:38 AM
Herald added a subscriber: wdng. · View Herald Transcript
dp accepted this revision.May 6 2021, 8:09 AM

LGTM. I must note that this is a badly documented feature. I found no description of DPP64 limitations in AMD spec and sp3 is of no help either.

This revision is now accepted and ready to land.May 6 2021, 8:09 AM
This revision was automatically updated to reflect the committed changes.