Page MenuHomePhabricator

[AMDGPU][OpenMP] Emit textual IR for -emit-llvm -S
ClosedPublic

Authored by pdhaliwal on May 7 2021, 4:40 AM.

Details

Summary

Previously clang would print a binary blob into the bundled file
for amdgcn. With this patch, it will instead print textual IR as
expected.

Diff Detail

Event Timeline

pdhaliwal created this revision.May 7 2021, 4:40 AM
pdhaliwal requested review of this revision.May 7 2021, 4:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2021, 4:40 AM
JonChesterfield added inline comments.May 7 2021, 4:56 AM
clang/lib/Driver/ToolChains/Clang.cpp
4397–4403

Does unconditionally using emit-llvm here achieve the same result?

pdhaliwal added inline comments.May 7 2021, 5:09 AM
clang/lib/Driver/ToolChains/Clang.cpp
4397–4403

Nope, it would start producing textual IR even when there was no -emit-llvm -S. This could be problematic since we always have been producing .bc files including our libraries.

JonChesterfield accepted this revision.May 7 2021, 5:54 AM

Ah, yes. Thanks!

This revision is now accepted and ready to land.May 7 2021, 5:54 AM
This revision was landed with ongoing or failed builds.May 10 2021, 12:54 AM
This revision was automatically updated to reflect the committed changes.

This is not working as expected. And has resulted in broken libomptarget tests. Reverting this until I find a different fix.

pdhaliwal reopened this revision.May 12 2021, 4:16 AM
This revision is now accepted and ready to land.May 12 2021, 4:16 AM
pdhaliwal updated this revision to Diff 344763.May 12 2021, 4:16 AM

Fixed the if-else logic

pdhaliwal requested review of this revision.May 12 2021, 4:16 AM

Tested on gfx906. The libomptarget tests are working as expected.

ronlieb accepted this revision.May 12 2021, 4:20 AM
This revision is now accepted and ready to land.May 12 2021, 4:20 AM
This revision was automatically updated to reflect the committed changes.