[PATCH] D42922: [CUDA] Register relocatable GPU binaries

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 19 10:17:37 PDT 2018


tra added inline comments.


================
Comment at: lib/CodeGen/CGCUDANV.cpp:283-285
+  llvm::FunctionType *RegisterGlobalsFnTy;
+  llvm::FunctionType *RegisterLinkedBinaryFnTy;
+  llvm::Function *DummyCallback;
----------------
Instead of tracking these through the conditionals of pretty long function, could we make these pointers class fields and init them in the constructor and make accessors return them and, possibly, assert that they are used if RDC is enabled?


================
Comment at: test/CodeGenCUDA/device-stub.cu:3-7
+// RUN:   | FileCheck %s --check-prefixes=CHECK,DEFAULT
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -fcuda-include-gpubinary %t -o -  -DNOGLOBALS \
 // RUN:   | FileCheck %s -check-prefix=NOGLOBALS
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -fcuda-rdc -fcuda-include-gpubinary %t -o - \
+// RUN:   | FileCheck %s --check-prefixes=CHECK,RDC
----------------
Labels could be a bit more descriptive:
CHECK -> ALL
DEFAULT -> NORDC

Long RUN lines could use some re-wrapping.


https://reviews.llvm.org/D42922





More information about the cfe-commits mailing list