This is an archive of the discontinued LLVM Phabricator instance.

Add inliner interface for GPU dialect
ClosedPublic

Authored by bondhugula on Jan 9 2022, 5:26 AM.

Details

Summary

Add inliner interface for GPU dialect. The interface marks all GPU
dialect ops legal to inline anywhere.

Diff Detail

Event Timeline

bondhugula created this revision.Jan 9 2022, 5:26 AM
bondhugula requested review of this revision.Jan 9 2022, 5:26 AM
bondhugula added a comment.EditedJan 9 2022, 5:30 AM

I couldn't immediately find anything that should be prevented from inlining. I can refine the condition if there are such situations.

Is it legal though? Should we have something like gpu.thread_id outside of a GPU function/module? I would rather think it is legal to inline GPU functions into GPU functions.

Is it legal though? Should we have something like gpu.thread_id outside of a GPU function/module? I would rather think it is legal to inline GPU functions into GPU functions.

Calling a gpu function from a non-gpu function should be illegal anyway, so this situation cannot really arise. And the gpu.launch is not a call in the sense of the inlining interface.

ftynse accepted this revision.Jan 10 2022, 3:09 AM

Would be nice to have a test to clarify this. LGTM otherwise.

This revision is now accepted and ready to land.Jan 10 2022, 3:09 AM

Add a test case.

Would be nice to have a test to clarify this. LGTM otherwise.

Done.

This revision was landed with ongoing or failed builds.Jan 11 2022, 11:29 PM
This revision was automatically updated to reflect the committed changes.