This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix hazard handling of v_cmpx to permlane
ClosedPublic

Authored by rampitec on Jun 8 2022, 1:50 PM.

Details

Summary
  • VOP3 and SDWA forms of V_CMPX were not handled
  • Hazard only exists if the compare defines EXEC (i.e. V_CMPX) forwarded to the permlane.

Diff Detail

Event Timeline

rampitec created this revision.Jun 8 2022, 1:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 1:50 PM
rampitec requested review of this revision.Jun 8 2022, 1:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 1:50 PM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec updated this revision to Diff 435318.Jun 8 2022, 1:57 PM

Split of sdwa test, it is not supported on gfx1100.

@Joe_Nash, @foad actually is this hazard even exists on gfx11?

Split of sdwa test, it is not supported on gfx1100.

@Joe_Nash, @foad actually is this hazard even exists on gfx11?

As far as I can tell it does not exist already in the gfx1030. Is there any reason gfx1100 has FeatureVcmpxPermlaneHazard?

Split of sdwa test, it is not supported on gfx1100.

@Joe_Nash, @foad actually is this hazard even exists on gfx11?

As far as I can tell it does not exist already in the gfx1030. Is there any reason gfx1100 has FeatureVcmpxPermlaneHazard?

OK, found it in the gfx11 spec.

foad accepted this revision.Jun 9 2022, 1:37 AM

LGTM as-is, but perhaps it is time to introduce an "IsCMPX" helper function?

Does this also handle DPP forms of compares?

Maybe add a negative test for v_cmp->permlane since that is part of what you have fixed.

This revision is now accepted and ready to land.Jun 9 2022, 1:37 AM
foad added a comment.Jun 9 2022, 1:41 AM

Does this also handle DPP forms of compares?

Oh I forgot, these don't exist yet, until D126989 is landed.

LGTM as-is, but perhaps it is time to introduce an "IsCMPX" helper function?

Does this also handle DPP forms of compares?

Maybe add a negative test for v_cmp->permlane since that is part of what you have fixed.

There is no DPP form because gfx11 VOPC DPP is not yet sumbitted AFAIR.

I didn't want to add a negative test because even initial form was very conservative. It is almost impossible to run into that hazard, so the check was very relaxed and catching more than needed. I'd prefer to add a negative test after gfx11 code for this is settled, as we yet didn't agree on the tsflag bits for that.

As a side note: I tend to distrust documentation. This is documented as affecting 1000-1014 as a bug, then disappear, then appear again as an official hazard in 1100. So I have a good reason to think it also exists everywhere between 1014 and 1100 as well. But this is only my speculation.

Joe_Nash accepted this revision.Jun 9 2022, 8:02 AM

LGTM

This revision was landed with ongoing or failed builds.Jun 9 2022, 10:34 AM
This revision was automatically updated to reflect the committed changes.