1111#include  " llvm/ADT/SmallString.h" 
1212#include  " llvm/ADT/SmallVector.h" 
1313#include  " llvm/ADT/StringSet.h" 
14- #include  " llvm/Demangle/Demangle.h" 
1514#include  " llvm/IR/PassInstrumentation.h" 
1615#include  " llvm/SYCLLowerIR/CompileTimePropertiesPass.h" 
1716#include  " llvm/SYCLLowerIR/DeviceGlobals.h" 
@@ -32,7 +31,7 @@ namespace llvm::sycl {
3231namespace  {
3332module_split::SyclEsimdSplitStatus
3433getSYCLESIMDSplitStatusFromMetadata (const  Module &M) {
35-   auto  *SplitMD = M.getNamedMetadata (module_split::SYCL_ESIMD_SPLIT_MD_NAME );
34+   auto  *SplitMD = M.getNamedMetadata (module_split::SyclEsimdSplitMdName );
3635  assert (SplitMD && " Unexpected metadata"  );
3736  auto  *MDOp = SplitMD->getOperand (0 );
3837  assert (MDOp && " Unexpected metadata operand"  );
@@ -67,7 +66,7 @@ bool isModuleUsingTsan(const Module &M) {
6766//  Optional.
6867//  Otherwise, it returns an Optional containing a list of reached
6968//  SPIR kernel function's names.
70- std::optional<std::vector<StringRef>>
69+ static   std::optional<std::vector<StringRef>>
7170traverseCGToFindSPIRKernels (const  Function *StartingFunction) {
7271  std::queue<const  Function *> FunctionsToVisit;
7372  std::unordered_set<const  Function *> VisitedFunctions;
@@ -106,7 +105,8 @@ traverseCGToFindSPIRKernels(const Function *StartingFunction) {
106105
107106  return  {std::move (KernelNames)};
108107}
109- std::vector<StringRef> getKernelNamesUsingAssert (const  Module &M) {
108+ 
109+ static  std::vector<StringRef> getKernelNamesUsingAssert (const  Module &M) {
110110  auto  *DevicelibAssertFailFunction = M.getFunction (" __devicelib_assert_fail"  );
111111  if  (!DevicelibAssertFailFunction)
112112    return  {};
@@ -131,8 +131,8 @@ std::vector<StringRef> getKernelNamesUsingAssert(const Module &M) {
131131//  Gets 1- to 3-dimension work-group related information for function Func.
132132//  Returns an empty vector if not present.
133133template  <typename  T>
134- std::vector<T> getKernelWorkGroupMetadata (const  Function &Func,
135-                                           const  char  *MDName) {
134+ static   std::vector<T> getKernelWorkGroupMetadata (const  Function &Func,
135+                                              const  char  *MDName) {
136136  MDNode *WorkGroupMD = Func.getMetadata (MDName);
137137  if  (!WorkGroupMD)
138138    return  {};
@@ -149,8 +149,8 @@ std::vector<T> getKernelWorkGroupMetadata(const Function &Func,
149149//  Gets a single-dimensional piece of information for function Func.
150150//  Returns std::nullopt if metadata is not present.
151151template  <typename  T>
152- std::optional<T> getKernelSingleEltMetadata (const  Function &Func,
153-                                             const  char  *MDName) {
152+ static   std::optional<T> getKernelSingleEltMetadata (const  Function &Func,
153+                                                const  char  *MDName) {
154154  if  (MDNode *MaxDimMD = Func.getMetadata (MDName)) {
155155    assert (MaxDimMD->getNumOperands () == 1  && " Malformed node."  );
156156    return  mdconst::extract<ConstantInt>(MaxDimMD->getOperand (0 ))
@@ -543,6 +543,7 @@ PropSetRegTy computeModuleProperties(const Module &M,
543543
544544  return  PropSet;
545545}
546+ 
546547std::string computeModuleSymbolTable (const  Module &M,
547548                                     const  EntryPointSet &EntryPoints) {
548549
0 commit comments