This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Partially fix machine uniformity for inline asm
ClosedPublic

Authored by arsenm on Jan 18 2023, 7:18 AM.

Details

Reviewers
sameerds
Pierre-vh
Petar.Avramovic
aemerson
paquette
foad
nhaehnle
Group Reviewers
Restricted Project
Summary

This was assuming virtual registers only, and asserting on physical.
This was also ignoring AGPRs, and only considering VGPRs.

Reporting the instruction as uniform or not is conceptually wrong,
this should be reported per-operand. An inline asm statement could
include uniform and non-uniform components. This should report
purely for the register defs and ignore the uses.

Fixes asserting on most of the inline asm tests when uniformity
analysis is used.

Diff Detail

Event Timeline

arsenm created this revision.Jan 18 2023, 7:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 7:18 AM
arsenm requested review of this revision.Jan 18 2023, 7:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 7:18 AM
Herald added a subscriber: wdng. · View Herald Transcript
foad added a comment.Jan 19 2023, 1:46 AM

Is there a way to test this?

Can this be tested or is it tested as part of D142021?
The changes make sense to me but without seeing codegen changes, it's difficult to really understand what's going on

Is there a way to test this?

The existing tests break if you flip uniformity analysis on, so I think this is mostly well covered. We might want additional asm testing when the API is fixed to be per output

No more comments from me but I don't have enough experience with uniformity analysis to approve

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
8407–8416

Variable names need to start with an upper case letter

arsenm added inline comments.Jan 29 2023, 5:00 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
8407–8416

This is just moving existing code, rename should be separate

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