Skip to content

Commit 33f6ea4

Browse files
sndmitrievbader
authored andcommitted
[SYCL] Remove unused clang-offload-wrapper options (#1041)
Signed-off-by: Sergey Dmitriev <[email protected]>
1 parent 3adb4a5 commit 33f6ea4

File tree

2 files changed

+3
-32
lines changed

2 files changed

+3
-32
lines changed

clang/test/Driver/clang-offload-wrapper.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949
// CHECK-HELP: {{.*}} =hip - HIP
5050
// CHECK-HELP: {{.*}} =sycl - SYCL
5151
// CHECK-HELP: {{.*}} -o=<filename> - Output filename
52-
// CHECK-HELP: {{.*}} --reg-func-name=<name> - Offload descriptor registration function name
5352
// CHECK-HELP: {{.*}} --target=<string> - offload target triple
54-
// CHECK-HELP: {{.*}} --unreg-func-name=<name> - Offload descriptor un-registration function name
5553
// CHECK-HELP: {{.*}} -v - verbose output
5654

5755
// -------
@@ -143,23 +141,6 @@
143141
// CHECK-IR1-NOT: @llvm.global_dtors
144142
// 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 }
145143

146-
// -------
147-
// Check options' effects: -reg-func-name, -unreg-func-name
148-
//
149-
// 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
150-
// CHECK-IR2: source_filename = "offload.wrapper.object"
151-
// CHECK-IR2: define internal void {{.+}}()
152-
// CHECK-IR2: call void @__REGFUNC__
153-
// CHECK-IR2: ret void
154-
155-
// CHECK-IR2: declare void @__REGFUNC__
156-
157-
// CHECK-IR2: define internal void {{.+}}()
158-
// CHECK-IR2: call void @__UNREGFUNC__
159-
// CHECK-IR2: ret void
160-
161-
// CHECK-IR2: declare void @__UNREGFUNC__
162-
163144
// -------
164145
// Check option's effects: -entries
165146
//

clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,6 @@ static cl::opt<bool> EmitRegFuncs("emit-reg-funcs", cl::NotHidden,
155155
cl::desc("Emit [un-]registration functions"),
156156
cl::cat(ClangOffloadWrapperCategory));
157157

158-
static cl::opt<std::string>
159-
RegFuncName("reg-func-name", cl::Optional, cl::init("__tgt_register_lib"),
160-
cl::desc("Offload descriptor registration function name"),
161-
cl::value_desc("name"), cl::cat(ClangOffloadWrapperCategory));
162-
163-
static cl::opt<std::string>
164-
UnregFuncName("unreg-func-name", cl::Optional,
165-
cl::init("__tgt_unregister_lib"),
166-
cl::desc("Offload descriptor un-registration function name"),
167-
cl::value_desc("name"), cl::cat(ClangOffloadWrapperCategory));
168-
169158
static cl::opt<std::string> DescriptorName(
170159
"desc-name", cl::Optional, cl::init("descriptor"),
171160
cl::desc(
@@ -769,7 +758,8 @@ class BinaryWrapper {
769758
// Get RegFuncName function declaration.
770759
auto *RegFuncTy = FunctionType::get(Type::getVoidTy(C), getBinDescPtrTy(),
771760
/*isVarArg*/ false);
772-
FunctionCallee RegFuncC = M.getOrInsertFunction(RegFuncName, RegFuncTy);
761+
FunctionCallee RegFuncC =
762+
M.getOrInsertFunction("__tgt_register_lib", RegFuncTy);
773763

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

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

0 commit comments

Comments
 (0)