Skip to content

Commit c054d0f

Browse files
committed
rename splitSYCLModule to SYCLSplitModule
1 parent 521ff0d commit c054d0f

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

llvm/include/llvm/Transforms/Utils/SYCLModuleSplit.h renamed to llvm/include/llvm/Transforms/Utils/SYCLSplitModule.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-------- SYCLModuleSplit.h - module split ------------------*- C++ -*-===//
1+
//===-------- SYCLSplitModule.h - module split ------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
1010
// of the split is new modules containing corresponding callgraph.
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef LLVM_SYCL_MODULE_SPLIT_H
14-
#define LLVM_SYCL_MODULE_SPLIT_H
13+
#ifndef LLVM_SYCL_SPLIT_MODULE_H
14+
#define LLVM_SYCL_SPLIT_MODULE_H
1515

1616
#include "llvm/ADT/SmallVector.h"
1717
#include "llvm/ADT/StringRef.h"
@@ -38,17 +38,17 @@ std::optional<IRSplitMode> convertStringToSplitMode(StringRef S);
3838
/// The structure represents a split LLVM Module accompanied by additional
3939
/// information. Split Modules are being stored at disk due to the high RAM
4040
/// consumption during the whole splitting process.
41-
struct SYCLSplitModule {
41+
struct ModuleAndSYCLMetadata {
4242
std::string ModuleFilePath;
4343
std::string Symbols;
4444

45-
SYCLSplitModule() = default;
46-
SYCLSplitModule(const SYCLSplitModule &) = default;
47-
SYCLSplitModule &operator=(const SYCLSplitModule &) = default;
48-
SYCLSplitModule(SYCLSplitModule &&) = default;
49-
SYCLSplitModule &operator=(SYCLSplitModule &&) = default;
45+
ModuleAndSYCLMetadata() = default;
46+
ModuleAndSYCLMetadata(const ModuleAndSYCLMetadata &) = default;
47+
ModuleAndSYCLMetadata &operator=(const ModuleAndSYCLMetadata &) = default;
48+
ModuleAndSYCLMetadata(ModuleAndSYCLMetadata &&) = default;
49+
ModuleAndSYCLMetadata &operator=(ModuleAndSYCLMetadata &&) = default;
5050

51-
SYCLSplitModule(std::string_view File, std::string Symbols)
51+
ModuleAndSYCLMetadata(std::string_view File, std::string Symbols)
5252
: ModuleFilePath(File), Symbols(std::move(Symbols)) {}
5353
};
5454

@@ -59,13 +59,13 @@ struct ModuleSplitterSettings {
5959
};
6060

6161
/// Parses the string table.
62-
Expected<SmallVector<SYCLSplitModule, 0>>
63-
parseSYCLSplitModulesFromFile(StringRef File);
62+
Expected<SmallVector<ModuleAndSYCLMetadata, 0>>
63+
parseModuleAndSYCLMetadataFromFile(StringRef File);
6464

6565
/// Splits the given module \p M according to the given \p Settings.
66-
Expected<SmallVector<SYCLSplitModule, 0>>
67-
splitSYCLModule(std::unique_ptr<Module> M, ModuleSplitterSettings Settings);
66+
Expected<SmallVector<ModuleAndSYCLMetadata, 0>>
67+
SYCLSplitModule(std::unique_ptr<Module> M, ModuleSplitterSettings Settings);
6868

6969
} // namespace llvm
7070

71-
#endif // LLVM_SYCL_MODULE_SPLIT_H
71+
#endif // LLVM_SYCL_SPLIT_MODULE_H

llvm/lib/Transforms/Utils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ add_llvm_component_library(LLVMTransformUtils
8383
SizeOpts.cpp
8484
SplitModule.cpp
8585
StripNonLineTableDebugInfo.cpp
86-
SYCLModuleSplit.cpp
86+
SYCLSplitModule.cpp
8787
SYCLUtils.cpp
8888
SymbolRewriter.cpp
8989
UnifyFunctionExitNodes.cpp

llvm/lib/Transforms/Utils/SYCLModuleSplit.cpp renamed to llvm/lib/Transforms/Utils/SYCLSplitModule.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-------- SYCLModuleSplitter.cpp - split a module into callgraphs -----===//
1+
//===-------- SYCLSplitModule.cpp - split a module into callgraphs --------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -8,7 +8,7 @@
88
// See comments in the header.
99
//===----------------------------------------------------------------------===//
1010

11-
#include "llvm/Transforms/Utils/SYCLModuleSplit.h"
11+
#include "llvm/Transforms/Utils/SYCLSplitModule.h"
1212
#include "llvm/ADT/SetVector.h"
1313
#include "llvm/ADT/SmallPtrSet.h"
1414
#include "llvm/ADT/StringExtras.h"
@@ -38,7 +38,7 @@
3838

3939
using namespace llvm;
4040

41-
#define DEBUG_TYPE "sycl-module-split"
41+
#define DEBUG_TYPE "sycl-split-module"
4242

4343
static bool isKernel(const Function &F) {
4444
return F.getCallingConv() == CallingConv::SPIR_KERNEL ||
@@ -410,22 +410,22 @@ static Error saveModuleIRInFile(Module &M, StringRef FilePath,
410410
return Error::success();
411411
}
412412

413-
static Expected<SYCLSplitModule>
413+
static Expected<ModuleAndSYCLMetadata>
414414
saveModuleDesc(ModuleDesc &MD, std::string Prefix, bool OutputAssembly) {
415415
Prefix += OutputAssembly ? ".ll" : ".bc";
416416
if (Error E = saveModuleIRInFile(MD.getModule(), Prefix, OutputAssembly))
417417
return E;
418418

419-
SYCLSplitModule SM;
419+
ModuleAndSYCLMetadata SM;
420420
SM.ModuleFilePath = Prefix;
421421
SM.Symbols = MD.makeSymbolTable();
422422
return SM;
423423
}
424424

425425
namespace llvm {
426426

427-
Expected<SmallVector<SYCLSplitModule, 0>>
428-
parseSYCLSplitModulesFromFile(StringRef File) {
427+
Expected<SmallVector<ModuleAndSYCLMetadata, 0>>
428+
parseModuleAndSYCLMetadataFromFile(StringRef File) {
429429
auto EntriesMBOrErr = llvm::MemoryBuffer::getFile(File);
430430
if (!EntriesMBOrErr)
431431
return createFileError(File, EntriesMBOrErr.getError());
@@ -438,7 +438,7 @@ parseSYCLSplitModulesFromFile(StringRef File) {
438438
// "Code" and "Symbols" at the moment.
439439
static constexpr int NUMBER_COLUMNS = 2;
440440
++LI;
441-
SmallVector<SYCLSplitModule, 0> Modules;
441+
SmallVector<ModuleAndSYCLMetadata, 0> Modules;
442442
while (!LI.is_at_eof()) {
443443
StringRef Line = *LI;
444444
if (Line.empty())
@@ -480,9 +480,9 @@ std::optional<IRSplitMode> convertStringToSplitMode(StringRef S) {
480480
return It->second;
481481
}
482482

483-
Expected<SmallVector<SYCLSplitModule, 0>>
484-
splitSYCLModule(std::unique_ptr<Module> M, ModuleSplitterSettings Settings) {
485-
SmallVector<SYCLSplitModule, 0> OutputImages;
483+
Expected<SmallVector<ModuleAndSYCLMetadata, 0>>
484+
SYCLSplitModule(std::unique_ptr<Module> M, ModuleSplitterSettings Settings) {
485+
SmallVector<ModuleAndSYCLMetadata, 0> OutputImages;
486486
if (Settings.Mode == IRSplitMode::IRSM_NONE) {
487487
ModuleDesc MD = std::move(M);
488488
std::string OutIRFileName = (Settings.OutputPrefix + Twine("_0")).str();

llvm/tools/llvm-split/llvm-split.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "llvm/Support/raw_ostream.h"
2929
#include "llvm/Target/TargetMachine.h"
3030
#include "llvm/TargetParser/Triple.h"
31-
#include "llvm/Transforms/Utils/SYCLModuleSplit.h"
31+
#include "llvm/Transforms/Utils/SYCLSplitModule.h"
3232
#include "llvm/Transforms/Utils/SYCLUtils.h"
3333
#include "llvm/Transforms/Utils/SplitModule.h"
3434

@@ -99,12 +99,12 @@ void writeStringToFile(std::string_view Content, StringRef Path) {
9999
OS << Content << "\n";
100100
}
101101

102-
void writeSplitModulesAsTable(ArrayRef<SYCLSplitModule> SplitModules,
102+
void writeSplitModulesAsTable(ArrayRef<ModuleAndSYCLMetadata> Modules,
103103
StringRef Path) {
104104
std::vector<std::string> Columns = {"Code", "Symbols"};
105105
SYCLStringTable Table;
106106
Table.emplace_back(std::move(Columns));
107-
for (const auto &[I, SM] : enumerate(SplitModules)) {
107+
for (const auto &[I, SM] : enumerate(Modules)) {
108108
std::string SymbolsFile = (Twine(Path) + "_" + Twine(I) + ".sym").str();
109109
writeStringToFile(SM.Symbols, SymbolsFile);
110110
std::vector<std::string> Row = {SM.ModuleFilePath, SymbolsFile};
@@ -126,11 +126,11 @@ Error runSYCLSplitModule(std::unique_ptr<Module> M) {
126126
Settings.Mode = SYCLSplitMode;
127127
Settings.OutputAssembly = OutputAssembly;
128128
Settings.OutputPrefix = OutputFilename;
129-
auto SplitModulesOrErr = splitSYCLModule(std::move(M), Settings);
130-
if (!SplitModulesOrErr)
131-
return SplitModulesOrErr.takeError();
129+
auto ModulesOrErr = SYCLSplitModule(std::move(M), Settings);
130+
if (!ModulesOrErr)
131+
return ModulesOrErr.takeError();
132132

133-
writeSplitModulesAsTable(*SplitModulesOrErr, OutputFilename);
133+
writeSplitModulesAsTable(*ModulesOrErr, OutputFilename);
134134
return Error::success();
135135
}
136136

0 commit comments

Comments
 (0)