Skip to content

Commit 783be99

Browse files
committed
[MLIR][mlir-link] Remove internalization for now
1 parent 007073f commit 783be99

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

mlir/include/mlir/Linker/Linker.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@
1515

1616
namespace mlir::link {
1717

18-
using InternalizeCallbackFn =
19-
std::function<void(ModuleOp, const StringSet<> &)>;
20-
2118
/// These are gathered alphabetically sorted linker options
2219
class LinkerConfig {
2320
public:
24-
/// Allow operation with no registered dialects.
25-
/// This option is for convenience during testing only and discouraged in
26-
/// general.
2721
LinkerConfig &allowUnregisteredDialects(bool allow) {
2822
allowUnregisteredDialectsFlag = allow;
2923
return *this;
@@ -32,28 +26,15 @@ class LinkerConfig {
3226
return allowUnregisteredDialectsFlag;
3327
}
3428

35-
LinkerConfig &internalizeLinkedSymbols(bool allow) {
36-
internalizeLinkedSymbolsFlag = allow;
37-
return *this;
38-
}
39-
bool shouldInternalizeLinkedSymbols() const {
40-
return internalizeLinkedSymbolsFlag;
41-
}
42-
4329
LinkerConfig &linkOnlyNeeded(bool allow) {
4430
linkOnlyNeededFlag = allow;
4531
return *this;
4632
}
4733
bool shouldLinkOnlyNeeded() const { return linkOnlyNeededFlag; }
4834

4935
protected:
50-
/// Allow operation with no registered dialects.
51-
/// This option is for convenience during testing only and discouraged in
52-
/// general.
5336
bool allowUnregisteredDialectsFlag = false;
5437

55-
bool internalizeLinkedSymbolsFlag = false;
56-
5738
bool linkOnlyNeededFlag = false;
5839
};
5940

@@ -72,7 +53,6 @@ class Linker {
7253

7354
struct LinkFileConfig {
7455
unsigned flags = Flags::None;
75-
bool internalize = false;
7656
};
7757

7858
Linker(const LinkerConfig &config, MLIRContext *context)

mlir/lib/Linker/Linker.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ class ModuleLinker {
7575
}
7676

7777
public:
78-
ModuleLinker(IRMover &mover, OwningOpRef<Operation *> src, unsigned flags,
79-
InternalizeCallbackFn internalizeCallback = {})
78+
ModuleLinker(IRMover &mover, OwningOpRef<Operation *> src, unsigned flags)
8079
: mover(mover), src(std::move(src)), flags(flags) {}
8180
LogicalResult run();
8281
};
@@ -293,7 +292,7 @@ unsigned Linker::getFlags() const {
293292
}
294293

295294
Linker::LinkFileConfig Linker::linkFileConfig(unsigned fileFlags) const {
296-
return {fileFlags, config.shouldInternalizeLinkedSymbols()};
295+
return {.flags = fileFlags};
297296
}
298297

299298
Linker::LinkFileConfig Linker::firstFileConfig(unsigned fileFlags) const {

mlir/lib/Tools/mlir-link/MlirLinkMain.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ struct LinkerCLOptions : public LinkerConfig {
8282
cl::location(allowUnregisteredDialectsFlag), cl::init(false),
8383
cl::cat(getCategory()));
8484

85-
static cl::opt<bool, true> internalizeLinkedSymbols(
86-
"internalize", cl::desc("Internalize linked symbols"),
87-
cl::location(internalizeLinkedSymbolsFlag), cl::init(false),
88-
cl::cat(getCategory()));
89-
9085
static cl::opt<bool, true> linkOnlyNeeded(
9186
"only-needed", cl::desc("Link only needed symbols"),
9287
cl::location(linkOnlyNeededFlag), cl::init(false),

0 commit comments

Comments
 (0)