Skip to content

Commit 6aabc44

Browse files
committed
[MLIR][mlir-link] Simplify and generalize linker interfaces
1 parent 56edbf5 commit 6aabc44

File tree

21 files changed

+819
-1776
lines changed

21 files changed

+819
-1776
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "mlir/Interfaces/ControlFlowInterfaces.h"
2929
#include "mlir/Interfaces/FunctionInterfaces.h"
3030
#include "mlir/Interfaces/InferTypeOpInterface.h"
31-
#include "mlir/Interfaces/LinkageInterfaces.h"
3231
#include "mlir/Interfaces/SideEffectInterfaces.h"
3332
#include "mlir/Interfaces/ViewLikeInterface.h"
3433
#include "mlir/Support/ThreadLocalCache.h"

mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ include "mlir/IR/SymbolInterfaces.td"
2222
include "mlir/Interfaces/CallInterfaces.td"
2323
include "mlir/Interfaces/ControlFlowInterfaces.td"
2424
include "mlir/Interfaces/InferTypeOpInterface.td"
25-
include "mlir/Interfaces/LinkageInterfaces.td"
2625
include "mlir/Interfaces/MemorySlotInterfaces.td"
2726
include "mlir/Interfaces/SideEffectInterfaces.td"
2827
include "mlir/Interfaces/ViewLikeInterface.td"
@@ -1227,10 +1226,7 @@ def LLVM_AddressOfOp : LLVM_Op<"mlir.addressof",
12271226
}
12281227

12291228
def LLVM_GlobalOp : LLVM_Op<"mlir.global",
1230-
[IsolatedFromAbove, SingleBlockImplicitTerminator<"ReturnOp">, Symbol,
1231-
GlobalVariableLinkageOpInterface,
1232-
DeclareOpInterfaceMethods<GlobalValueLinkageOpInterface>,
1233-
DeclareOpInterfaceMethods<GlobalVariableLinkageOpInterface>]> {
1229+
[IsolatedFromAbove, SingleBlockImplicitTerminator<"ReturnOp">, Symbol]> {
12341230
let arguments = (ins
12351231
TypeAttr:$global_type,
12361232
UnitAttr:$constant,
@@ -1382,9 +1378,6 @@ def LLVM_GlobalOp : LLVM_Op<"mlir.global",
13821378
}
13831379
}];
13841380

1385-
let extraClassDefinition = [{
1386-
bool $cppClass::isDeclarationForLinkage() { return getInitializerRegion().empty() && !getValue(); }
1387-
}];
13881381
let hasCustomAssemblyFormat = 1;
13891382
let hasVerifier = 1;
13901383
let hasRegionVerifier = 1;
@@ -1500,9 +1493,7 @@ def LLVM_ComdatOp : LLVM_Op<"comdat", [NoTerminator, NoRegionArguments, SymbolTa
15001493
}
15011494

15021495
def LLVM_LLVMFuncOp : LLVM_Op<"func", [
1503-
AutomaticAllocationScope, IsolatedFromAbove, FunctionOpInterface,
1504-
FunctionLinkageOpInterface,
1505-
DeclareOpInterfaceMethods<GlobalValueLinkageOpInterface>]> {
1496+
AutomaticAllocationScope, IsolatedFromAbove, FunctionOpInterface]> {
15061497
let summary = "LLVM dialect function.";
15071498

15081499
let description = [{
@@ -1629,11 +1620,6 @@ def LLVM_LLVMFuncOp : LLVM_Op<"func", [
16291620

16301621
/// Returns true if the `optimize_none` attribute is set, false otherwise.
16311622
bool isOptimizeNone() { return bool(getOptimizeNoneAttr()); }
1632-
1633-
}];
1634-
1635-
let extraClassDefinition = [{
1636-
bool $cppClass::isDeclarationForLinkage() { return getBody().empty(); }
16371623
}];
16381624

16391625
let hasCustomAssemblyFormat = 1;

mlir/include/mlir/IR/BuiltinOps.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ include "mlir/IR/RegionKindInterface.td"
2020
include "mlir/IR/SymbolInterfaces.td"
2121
include "mlir/Interfaces/CastInterfaces.td"
2222
include "mlir/Interfaces/DataLayoutInterfaces.td"
23-
include "mlir/Interfaces/LinkageInterfaces.td"
2423
include "mlir/Interfaces/SideEffectInterfaces.td"
2524

2625
// Base class for Builtin dialect ops.

mlir/include/mlir/Interfaces/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ add_mlir_interface(DestinationStyleOpInterface)
77
add_mlir_interface(FunctionInterfaces)
88
add_mlir_interface(InferIntRangeInterface)
99
add_mlir_interface(InferTypeOpInterface)
10-
add_mlir_interface(LinkageInterfaces)
1110
add_mlir_interface(LoopLikeInterface)
1211
add_mlir_interface(ParallelCombiningOpInterface)
1312
add_mlir_interface(RuntimeVerifiableOpInterface)

mlir/include/mlir/Interfaces/LinkageInterfaces.h

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

mlir/include/mlir/Interfaces/LinkageInterfaces.td

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

0 commit comments

Comments
 (0)