This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: mark SET_INACTIVE_* as convergent operation
ClosedPublic

Authored by ruiling on Apr 5 2023, 11:45 PM.

Details

Summary

set_inactive is actually a kind of operation that is passing certain
value from active threads to inactive threads. In later WWM operation,
the activated threads which were disabled before would read such
values passed to them by set_inactive operation. So I think the
set_inactive is a convergent operation.

Diff Detail

Event Timeline

ruiling created this revision.Apr 5 2023, 11:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 11:45 PM
ruiling requested review of this revision.Apr 5 2023, 11:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 11:45 PM
nhaehnle accepted this revision.Apr 6 2023, 12:13 AM

Makes sense. The intrinsic was already marked convergent.

This revision is now accepted and ready to land.Apr 6 2023, 12:13 AM
foad accepted this revision.Apr 6 2023, 1:52 AM
This revision was landed with ongoing or failed builds.Apr 6 2023, 6:11 PM
This revision was automatically updated to reflect the committed changes.
arsenm added a comment.Apr 6 2023, 6:25 PM

Does tablegen not infer convergent instructions from the source pattern? I assume not (but I always found this to be a dubious feature)

Does tablegen not infer convergent instructions from the source pattern? I assume not (but I always found this to be a dubious feature)

I am not familiar with that part. Maybe we still prefer the convergent property being explicitly managed. But I think it might be helpful to at least generate warning if the pattern selection drops convergent property.

I don't think TableGen makes those kind of inferences, does it?

What it does do in some cases (around MayRead/MayWrite etc.) is complain if there is a mismatch between how the intrinsic is defined vs. how the instruction is defined in a pattern.