Skip to content

Commit 2c3e9b1

Browse files
authored
[SYCL] Clear usesAssert required by fallback assert (#20571)
The 'usesAssert' seems to be used by fallback assert mechanism which has beem discarded, create this PR to trigger pre-ci to see if any problem pops up if we remove the code snippet. --------- Signed-off-by: jinge90 <[email protected]>
1 parent fbb1edb commit 2c3e9b1

File tree

21 files changed

+6
-1061
lines changed

21 files changed

+6
-1061
lines changed

llvm/include/llvm/Support/PropertySetIO.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ class PropertySetRegistry {
216216
static constexpr char SYCL_KERNEL_PARAM_OPT_INFO[] = "SYCL/kernel param opt";
217217
static constexpr char SYCL_PROGRAM_METADATA[] = "SYCL/program metadata";
218218
static constexpr char SYCL_MISC_PROP[] = "SYCL/misc properties";
219-
static constexpr char SYCL_ASSERT_USED[] = "SYCL/assert used";
220219
static constexpr char SYCL_KERNEL_NAMES[] = "SYCL/kernel names";
221220
static constexpr char SYCL_EXPORTED_SYMBOLS[] = "SYCL/exported symbols";
222221
static constexpr char SYCL_IMPORTED_SYMBOLS[] = "SYCL/imported symbols";

llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -57,85 +57,6 @@ bool isModuleUsingTsan(const Module &M) {
5757
return M.getNamedGlobal("__TsanKernelMetadata");
5858
}
5959

60-
// This function traverses over reversed call graph by BFS algorithm.
61-
// It means that an edge links some function @func with functions
62-
// which contain call of function @func. It starts from
63-
// @StartingFunction and lifts up until it reach all reachable functions,
64-
// or it reaches some function containing "referenced-indirectly" attribute.
65-
// If it reaches "referenced-indirectly" attribute than it returns an empty
66-
// Optional.
67-
// Otherwise, it returns an Optional containing a list of reached
68-
// SPIR kernel function's names.
69-
static std::optional<std::vector<StringRef>> traverseCGToFindSPIRKernels(
70-
const std::vector<Function *> &StartingFunctionVec) {
71-
std::queue<const Function *> FunctionsToVisit;
72-
std::unordered_set<const Function *> VisitedFunctions;
73-
for (const Function *FPtr : StartingFunctionVec)
74-
FunctionsToVisit.push(FPtr);
75-
std::vector<StringRef> KernelNames;
76-
77-
while (!FunctionsToVisit.empty()) {
78-
const Function *F = FunctionsToVisit.front();
79-
FunctionsToVisit.pop();
80-
81-
auto InsertionResult = VisitedFunctions.insert(F);
82-
// It is possible that we insert some particular function several
83-
// times in functionsToVisit queue.
84-
if (!InsertionResult.second)
85-
continue;
86-
87-
for (const auto *U : F->users()) {
88-
const CallInst *CI = dyn_cast<const CallInst>(U);
89-
if (!CI)
90-
continue;
91-
92-
const Function *ParentF = CI->getFunction();
93-
94-
if (VisitedFunctions.count(ParentF))
95-
continue;
96-
97-
if (ParentF->hasFnAttribute("referenced-indirectly"))
98-
return {};
99-
100-
if (ParentF->getCallingConv() == CallingConv::SPIR_KERNEL)
101-
KernelNames.push_back(ParentF->getName());
102-
103-
FunctionsToVisit.push(ParentF);
104-
}
105-
}
106-
107-
return {std::move(KernelNames)};
108-
}
109-
110-
static std::vector<StringRef>
111-
getKernelNamesUsingSpecialFunctions(const Module &M,
112-
const std::vector<StringRef> &FNames) {
113-
std::vector<Function *> SpecialFunctionVec;
114-
for (const auto Fn : FNames) {
115-
Function *FPtr = M.getFunction(Fn);
116-
if (FPtr)
117-
SpecialFunctionVec.push_back(FPtr);
118-
}
119-
120-
if (SpecialFunctionVec.size() == 0)
121-
return {};
122-
123-
auto TraverseResult = traverseCGToFindSPIRKernels(SpecialFunctionVec);
124-
125-
if (TraverseResult.has_value())
126-
return std::move(*TraverseResult);
127-
128-
// Here we reached "referenced-indirectly", so we need to find all kernels and
129-
// return them.
130-
std::vector<StringRef> SPIRKernelNames;
131-
for (const Function &F : M) {
132-
if (F.getCallingConv() == CallingConv::SPIR_KERNEL)
133-
SPIRKernelNames.push_back(F.getName());
134-
}
135-
136-
return SPIRKernelNames;
137-
}
138-
13960
// Gets 1- to 3-dimension work-group related information for function Func.
14061
// Returns an empty vector if not present.
14162
template <typename T>
@@ -449,13 +370,6 @@ PropSetRegTy computeModuleProperties(const Module &M,
449370
if (OptLevel != -1)
450371
PropSet.add(PropSetRegTy::SYCL_MISC_PROP, "optLevel", OptLevel);
451372
}
452-
{
453-
std::vector<StringRef> AssertFuncNames{"__devicelib_assert_fail"};
454-
std::vector<StringRef> FuncNames =
455-
getKernelNamesUsingSpecialFunctions(M, AssertFuncNames);
456-
for (const StringRef &FName : FuncNames)
457-
PropSet.add(PropSetRegTy::SYCL_ASSERT_USED, FName, true);
458-
}
459373
{
460374
std::vector<std::pair<StringRef, int>> ArgPos =
461375
getKernelNamesUsingImplicitLocalMem(M);

llvm/lib/Support/PropertySetIO.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ constexpr char PropertySetRegistry::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES[];
200200
constexpr char PropertySetRegistry::SYCL_KERNEL_PARAM_OPT_INFO[];
201201
constexpr char PropertySetRegistry::SYCL_PROGRAM_METADATA[];
202202
constexpr char PropertySetRegistry::SYCL_MISC_PROP[];
203-
constexpr char PropertySetRegistry::SYCL_ASSERT_USED[];
204203
constexpr char PropertySetRegistry::SYCL_KERNEL_NAMES[];
205204
constexpr char PropertySetRegistry::SYCL_EXPORTED_SYMBOLS[];
206205
constexpr char PropertySetRegistry::SYCL_IMPORTED_SYMBOLS[];

llvm/test/tools/sycl-post-link/assert/indirect-with-split-2.ll

Lines changed: 0 additions & 165 deletions
This file was deleted.

0 commit comments

Comments
 (0)