This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] CodeGen for the "declare target" directive - variables, functions, ctors/dtors
AbandonedPublic

Authored by grokos on Feb 7 2018, 8:44 AM.

Details

Summary

This patch implements CodeGen support for the "declare target" directive.

Code is generated for variables, functions and ctors/dtors.

I understand that the patch as a whole is somewhat large; if this is the case and it cannot land in one go then let's discuss how it can be split. Due to this uncertainty I haven't included any regression tests, I'll upload them once the scope of each patch has been determined.

Diff Detail

Repository
rC Clang

Event Timeline

grokos created this revision.Feb 7 2018, 8:44 AM

It is impossible to understand what is going on here. We need to discuss this before even reviewing of this patch.

lib/CodeGen/CGCXXABI.h
543

Why do you need these additional parameters?

lib/CodeGen/CGDeclCXX.cpp
153–154

Why do you need these parameters?

588–590
  1. Check that this is the device codegen.
  2. Enclose in braces
lib/CodeGen/CGOpenMPRuntime.cpp
3484–3486

Just return !Entry->second.isRegistered();

lib/CodeGen/CGOpenMPRuntime.h
388

Remove briefs

508–509

Use enumeric values rather than the magical numbers.

559–563

Use enum constants rather than the magical numbers

grokos retitled this revision from [OpenMP] Support for implicit "declare target" functions - CodeGen patch to [OpenMP] CodeGen for the "declare target" directive - variables, functions, ctors/dtors.Feb 7 2018, 9:21 AM
grokos abandoned this revision.Mar 21 2018, 8:16 AM

@ABataev came up with a much simpler solution to the implementation of declare target: https://reviews.llvm.org/rL327636

I am abandoning this obsolete revision.