This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Partially fix getGenericInstructionUniformity
ClosedPublic

Authored by arsenm on Jan 20 2023, 7:23 AM.

Details

Reviewers
sameerds
Pierre-vh
foad
rovka
yassingh
Group Reviewers
Restricted Project
Summary

This was broken for the common case of instructions which are uniform
if their inputs are uniform. This is broken for control flow intrinsics
since the API currently does not express which result operand is in question.

This generates failures in just about every intrinsic test when uniformity
analysis is performed without this.

Diff Detail

Event Timeline

arsenm created this revision.Jan 20 2023, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 7:23 AM
arsenm requested review of this revision.Jan 20 2023, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 7:23 AM
Herald added a subscriber: wdng. · View Herald Transcript

This might not be related but what happens with control flow intrinsics that get preselected in legalizer?

This might not be related but what happens with control flow intrinsics that get preselected in legalizer?

They get preselected so they don't reach regbankselect in the usual compile flow. We should be able to compute correct uniformity information at any point, so it's not critical that the control flow intrinsics be correct to get something minimally functional

LGTM but I will leave it up to someone with experience with uniformity analysis to approve

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
8388

nit: If I understand correctly we would need an extra parameter to getGenericInstructionUniformity in order to handle this case, right?
Perhaps add that to the comment to make it clear that the API as-is doesn't give us enough information to tell?

sameerds accepted this revision.Jan 30 2023, 1:51 AM
This revision is now accepted and ready to land.Jan 30 2023, 1:51 AM