This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Translate reqd_work_group_size into amdgpu_flat_work_group_size
ClosedPublic

Authored by rampitec on Apr 5 2017, 3:11 PM.

Details

Summary

These two attributes specify the same info in a different way.
AMGPU BE only checks the latter as a target specific attribute
as opposed to language specific reqd_work_group_size.

This change produces amdgpu_flat_work_group_size out of
reqd_work_group_size if specified.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Apr 5 2017, 3:11 PM
yaxunl added inline comments.Apr 5 2017, 3:20 PM
lib/CodeGen/TargetInfo.cpp
7308 ↗(On Diff #94290)

should we emit some warning if they both exist and conflict with each other?

rampitec added inline comments.Apr 5 2017, 3:23 PM
lib/CodeGen/TargetInfo.cpp
7308 ↗(On Diff #94290)

I do not see any diagnostics here beyond asserts. I.e. if we need diagnostics we need it everywhere.

rampitec added inline comments.Apr 5 2017, 3:59 PM
lib/CodeGen/TargetInfo.cpp
7308 ↗(On Diff #94290)

I mean, there is assert below which checks if they disagree. The same way as other errors in attributes checked here.

rampitec updated this revision to Diff 94396.Apr 6 2017, 11:05 AM

Only produce amdgpu_flat_work_group_size if user's attribute is not present.

rampitec marked 3 inline comments as done.Apr 6 2017, 11:06 AM
rampitec added inline comments.
lib/CodeGen/TargetInfo.cpp
7308 ↗(On Diff #94290)

Actually I think an user shall never use both attributes together. Therefor I have inhibited this if user's attribute already present, deferring the resolution to RT.

yaxunl accepted this revision.Apr 6 2017, 11:22 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Apr 6 2017, 11:22 AM
This revision was automatically updated to reflect the committed changes.
rampitec marked an inline comment as done.