Skip to content

[SYCL] Remove unused clang-offload-wrapper options #1041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions clang/test/Driver/clang-offload-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
// CHECK-HELP: {{.*}} =hip - HIP
// CHECK-HELP: {{.*}} =sycl - SYCL
// CHECK-HELP: {{.*}} -o=<filename> - Output filename
// CHECK-HELP: {{.*}} --reg-func-name=<name> - Offload descriptor registration function name
// CHECK-HELP: {{.*}} --target=<string> - offload target triple
// CHECK-HELP: {{.*}} --unreg-func-name=<name> - Offload descriptor un-registration function name
// CHECK-HELP: {{.*}} -v - verbose output

// -------
Expand Down Expand Up @@ -143,23 +141,6 @@
// CHECK-IR1-NOT: @llvm.global_dtors
// CHECK-IR1: @.sycl_offloading.lalala = constant [[DESCTY]] { i16 1, i16 1, [[IMAGETY]]* getelementptr inbounds ([1 x [[IMAGETY]]], [1 x [[IMAGETY]]]* @.sycl_offloading.device_images, i64 0, i64 0), [[ENTTY]]* null, [[ENTTY]]* null }

// -------
// Check options' effects: -reg-func-name, -unreg-func-name
//
// RUN: clang-offload-wrapper -kind sycl -host=x86_64-pc-linux-gnu -reg-func-name=__REGFUNC__ -unreg-func-name=__UNREGFUNC__ -o - %t.tgt | llvm-dis | FileCheck %s --check-prefix CHECK-IR2
// CHECK-IR2: source_filename = "offload.wrapper.object"
// CHECK-IR2: define internal void {{.+}}()
// CHECK-IR2: call void @__REGFUNC__
// CHECK-IR2: ret void

// CHECK-IR2: declare void @__REGFUNC__

// CHECK-IR2: define internal void {{.+}}()
// CHECK-IR2: call void @__UNREGFUNC__
// CHECK-IR2: ret void

// CHECK-IR2: declare void @__UNREGFUNC__

// -------
// Check option's effects: -entries
//
Expand Down
16 changes: 3 additions & 13 deletions clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,6 @@ static cl::opt<bool> EmitRegFuncs("emit-reg-funcs", cl::NotHidden,
cl::desc("Emit [un-]registration functions"),
cl::cat(ClangOffloadWrapperCategory));

static cl::opt<std::string>
RegFuncName("reg-func-name", cl::Optional, cl::init("__tgt_register_lib"),
cl::desc("Offload descriptor registration function name"),
cl::value_desc("name"), cl::cat(ClangOffloadWrapperCategory));

static cl::opt<std::string>
UnregFuncName("unreg-func-name", cl::Optional,
cl::init("__tgt_unregister_lib"),
cl::desc("Offload descriptor un-registration function name"),
cl::value_desc("name"), cl::cat(ClangOffloadWrapperCategory));

static cl::opt<std::string> DescriptorName(
"desc-name", cl::Optional, cl::init("descriptor"),
cl::desc(
Expand Down Expand Up @@ -769,7 +758,8 @@ class BinaryWrapper {
// Get RegFuncName function declaration.
auto *RegFuncTy = FunctionType::get(Type::getVoidTy(C), getBinDescPtrTy(),
/*isVarArg*/ false);
FunctionCallee RegFuncC = M.getOrInsertFunction(RegFuncName, RegFuncTy);
FunctionCallee RegFuncC =
M.getOrInsertFunction("__tgt_register_lib", RegFuncTy);

// Construct function body
IRBuilder<> Builder(BasicBlock::Create(C, "entry", Func));
Expand All @@ -792,7 +782,7 @@ class BinaryWrapper {
auto *UnRegFuncTy = FunctionType::get(Type::getVoidTy(C), getBinDescPtrTy(),
/*isVarArg*/ false);
FunctionCallee UnRegFuncC =
M.getOrInsertFunction(UnregFuncName, UnRegFuncTy);
M.getOrInsertFunction("__tgt_unregister_lib", UnRegFuncTy);

// Construct function body
IRBuilder<> Builder(BasicBlock::Create(C, "entry", Func));
Expand Down