[PATCH] D64592: [OpenMP] Fix declare target link implementation
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 19 07:09:31 PDT 2019
ABataev added inline comments.
================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:2592-2593
llvm::raw_svector_ostream OS(PtrName);
- OS << CGM.getMangledName(GlobalDecl(VD)) << "_decl_tgt_ref_ptr";
+ unsigned DeviceID, Line;
+ unsigned FileID = 0;
+ OS << CGM.getMangledName(GlobalDecl(VD));
----------------
Move those 3 vars to `if` statement, they are not needed here.
================
Comment at: test/OpenMP/declare_target_link_codegen.cpp:22-23
+// HOST-DAG: @c_decl_tgt_ref_ptr = weak global i32* @c
+// HOST-DAG: @_{{.*}}d = internal global i32 2
+// HOST-DAG: @_{{.*}}d_{{.*}}_decl_tgt_ref_ptr = weak global i32* @_{{.*}}d
// DEVICE-NOT: @c =
----------------
Better to define the variable with the name of the original `d` variable for better and stable check
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64592/new/
https://reviews.llvm.org/D64592
More information about the cfe-commits
mailing list