This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Update target codegen for NVPTX device.
ClosedPublic

Authored by arpith-jacob on Dec 27 2016, 10:38 AM.

Details

Summary

This patch includes updates for codegen of the target region for the NVPTX
device. It moves initializers from the compiler to the runtime and updates
the worker loop to assume parallel work is retrieved from the runtime. A
subsequent patch will update the codegen to retrieve the parallel work using
calls to the runtime. It includes the removal setting appropriate attributes
for the worker loop and disabling debug info in it.

This allows codegen for generic target directives and serial execution on
the device.

Diff Detail

Event Timeline

arpith-jacob retitled this revision from to [OpenMP] Update target codegen for NVPTX device..
arpith-jacob updated this object.
arpith-jacob added a subscriber: cfe-commits.
ABataev added inline comments.Dec 28 2016, 3:03 AM
lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
248

I don't like the idea of using absolute numbers for alignment. Could use CreateDefaultAlignTempAlloca() instead?

250–251

The same

258–259

Better to use Bld.CreateIsNull().

266

Better to use Bld.CreateIsNotNull()

jlebar added a subscriber: jlebar.Dec 28 2016, 10:35 AM

Apologies for the drive-by review.

lib/CodeGen/CGOpenMPRuntimeNVPTX.h
30

This comment seems redundant with "private:" above?

Alexey and Justin, thank you for spending the time to review this patch. I've updated the patch accordingly. I've also removed a dot ('.') from the worker function name since the character is not accepted by the nvidia linker ptxas in function names.

arpith-jacob marked 5 inline comments as done.Dec 28 2016, 2:37 PM
ABataev accepted this revision.Dec 28 2016, 11:40 PM
ABataev edited edge metadata.

LG

This revision is now accepted and ready to land.Dec 28 2016, 11:40 PM
This revision was automatically updated to reflect the committed changes.