This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Support -emit-llvm for device compilation
ClosedPublic

Authored by yaxunl on Oct 1 2019, 11:16 AM.

Details

Summary

Sometimes it is useful to compile HIP device code to LLVM BC. It is not convenient to use clang -cc1 since
there are lots of options needed.

This patch allows clang driver to compile HIP device code to LLVM BC with -emit-llvm -c.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl created this revision.Oct 1 2019, 11:16 AM
ashi1 accepted this revision.Oct 1 2019, 2:25 PM
This revision is now accepted and ready to land.Oct 1 2019, 2:25 PM
tra accepted this revision.Oct 1 2019, 3:47 PM

LGTM.

Does it produce textual IR if used with -S?

yaxunl updated this revision to Diff 222826.Oct 2 2019, 6:57 AM

Make it work for -S

yaxunl added a comment.Oct 2 2019, 6:58 AM
In D68284#1690554, @tra wrote:

LGTM.

Does it produce textual IR if used with -S?

Now it produces textural IR if used with -S.

tra added a comment.Oct 2 2019, 10:12 AM

Could you also add a check for -S w/o -emit-llvm, too ? AFAICT it currently wants to produce a bundle, which is not very helpful.

tra accepted this revision.Oct 2 2019, 1:51 PM

LGTM. Thank you for fixing this.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2019, 8:26 PM