[FIX] Adaptation to llvm15/mlir15 only solves the build problem

This commit is contained in:
dingguangya 2023-08-07 16:19:59 +08:00
parent a7aeedcdd6
commit 2b7de02b88
2 changed files with 540 additions and 5 deletions

View File

@ -0,0 +1,528 @@
From d24ccb6c025688bc83dba720ce19fd63db51286e Mon Sep 17 00:00:00 2001
From: dingguangya <dingguangya1@huawei.com>
Date: Mon, 31 Jul 2023 19:36:45 +0800
Subject: [PATCH 1/2] [Pin-gcc-client] Adaptation to llvm15/mlir15 only solves
the build problem
diff --git a/include/Dialect/PluginDialect.td b/include/Dialect/PluginDialect.td
index 0edf301..ae8df3f 100644
--- a/include/Dialect/PluginDialect.td
+++ b/include/Dialect/PluginDialect.td
@@ -26,6 +26,7 @@
#define PLUGIN_DIALECT_TD
include "mlir/IR/OpBase.td"
+include "mlir/IR/EnumAttr.td"
//===----------------------------------------------------------------------===//
// Plugin Dialect Definition.
@@ -38,6 +39,10 @@ def Plugin_Dialect : Dialect {
let summary = "The Plugin Dialect.";
let description = [{}];
let cppNamespace = "::mlir::Plugin";
+
+ let extraClassDeclaration = [{
+ void registerTypes();
+ }];
}
// Base class for Plugin dialect operations. This operation inherits from the base
@@ -45,7 +50,7 @@ def Plugin_Dialect : Dialect {
// * The parent dialect of the operation.
// * The mnemonic for the operation, or the name without the dialect prefix.
// * A list of traits for the operation.
-class Plugin_Op<string mnemonic, list<OpTrait> traits = []> :
+class Plugin_Op<string mnemonic, list<Trait> traits = []> :
Op<Plugin_Dialect, mnemonic, traits>;
//===----------------------------------------------------------------------===//
@@ -114,4 +119,4 @@ def IExprCodeAttr : I32EnumAttr<
let cppNamespace = "::mlir::Plugin";
}
-#endif // PLUGIN_DIALECT_TD
\ No newline at end of file
+#endif // PLUGIN_DIALECT_TD
diff --git a/include/Dialect/PluginOps.td b/include/Dialect/PluginOps.td
index ba29f7e..d9b0893 100644
--- a/include/Dialect/PluginOps.td
+++ b/include/Dialect/PluginOps.td
@@ -40,7 +40,7 @@ def CGnodeOp : Plugin_Op<"callgraphnode", [NoSideEffect]> {
// the `state` that MLIR uses to create operations, i.e. these are used when
// using `builder.create<Op>(...)`.
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id,
+ OpBuilder<(ins "uint64_t":$id,
"StringRef":$symbolName,
"bool":$definition,
"uint32_t":$order)>
@@ -64,8 +64,8 @@ def FunctionOp : Plugin_Op<"function", [NoSideEffect]> {
// the `state` that MLIR uses to create operations, i.e. these are used when
// using `builder.create<Op>(...)`.
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "StringRef":$funcName, "bool":$declaredInline, "Type":$type, "bool":$validType)>,
- OpBuilderDAG<(ins "uint64_t":$id, "StringRef":$funcName, "bool":$declaredInline, "bool":$validType)>
+ OpBuilder<(ins "uint64_t":$id, "StringRef":$funcName, "bool":$declaredInline, "Type":$type, "bool":$validType)>,
+ OpBuilder<(ins "uint64_t":$id, "StringRef":$funcName, "bool":$declaredInline, "bool":$validType)>
];
let extraClassDeclaration = [{
Type getResultType();
@@ -81,7 +81,7 @@ def LocalDeclOp : Plugin_Op<"declaration", [NoSideEffect]> {
OptionalAttr<UI64Attr>:$typeWidth);
let regions = (region AnyRegion:$bodyRegion);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "StringRef":$symName,
+ OpBuilder<(ins "uint64_t":$id, "StringRef":$symName,
"int64_t":$typeID, "uint64_t":$typeWidth)>
];
}
@@ -98,7 +98,7 @@ def LoopOp : Plugin_Op<"loop", [NoSideEffect]> {
OptionalAttr<UI32Attr>:$numBlock);
let regions = (region AnyRegion:$bodyRegion);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint32_t":$index,
+ OpBuilder<(ins "uint64_t":$id, "uint32_t":$index,
"uint64_t":$innerLoopId, "uint64_t":$outerLoopId,
"uint32_t":$numBlock)>
];
@@ -118,9 +118,9 @@ def CallOp : Plugin_Op<"call", [
Variadic<AnyType>:$inputs);
let results = (outs Optional<AnyType>:$result);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint64_t":$address, "StringRef":$callee,
+ OpBuilder<(ins "uint64_t":$id, "uint64_t":$address, "StringRef":$callee,
"ArrayRef<Value>":$arguments, "Type":$retType)>,
- OpBuilderDAG<(ins "uint64_t":$id, "uint64_t":$address,
+ OpBuilder<(ins "uint64_t":$id, "uint64_t":$address,
"ArrayRef<Value>":$arguments,
"Type":$retType)>
];
@@ -141,7 +141,7 @@ def PhiOp : Plugin_Op<"phi", [NoSideEffect]> {
Variadic<AnyType>:$operands);
let results = (outs AnyType:$result);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint32_t":$capacity, "uint32_t":$nArgs,
+ OpBuilder<(ins "uint64_t":$id, "uint32_t":$capacity, "uint32_t":$nArgs,
"ArrayRef<Value>":$operands, "Type":$resultType)>
];
let extraClassDeclaration = [{
@@ -158,7 +158,7 @@ def AssignOp : Plugin_Op<"assign", [NoSideEffect]> {
Variadic<AnyType>:$operands);
let results = (outs AnyType:$result);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IExprCode":$exprCode,
+ OpBuilder<(ins "uint64_t":$id, "IExprCode":$exprCode,
"ArrayRef<Value>":$operands, "Type":$resultType)>
];
let extraClassDeclaration = [{
@@ -175,7 +175,7 @@ def NopOp : Plugin_Op<"nop", [NoSideEffect]> {
let arguments = (ins UI64Attr:$id);
let results = (outs AnyType:$result);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id)>,
+ OpBuilder<(ins "uint64_t":$id)>,
];
}
@@ -185,7 +185,7 @@ def EHElseOp : Plugin_Op<"eh_else", [NoSideEffect]> {
let arguments = (ins UI64Attr:$id, ArrayAttr:$nBody, ArrayAttr:$eBody);
let results = (outs AnyType:$result);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "ArrayRef<uint64_t>":$nBody, "ArrayRef<uint64_t>":$eBody)>,
+ OpBuilder<(ins "uint64_t":$id, "ArrayRef<uint64_t>":$nBody, "ArrayRef<uint64_t>":$eBody)>,
];
}
@@ -282,7 +282,7 @@ def PlaceholderOp : Placeholder<"palceholder"> {
let summary = "PlaceHolder";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "Type":$retType)>
];
}
@@ -291,7 +291,7 @@ def DeclBaseOp : DeclBase<"decl"> {
let summary = "DeclBaseOp";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "bool":$addressable, "bool":$used, "int":$uid, "Value":$initial,
"Value":$name, "Optional<uint64_t>":$chain, "Type":$retType)>
];
@@ -307,7 +307,7 @@ def BlockOp : BLOCK<"block"> {
let summary = "BlockOp";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "Optional<Value>":$vars, "Optional<uint64_t>":$supercontext,
"Optional<Value>":$subblocks, "Optional<Value>":$chain,
"Optional<Value>":$abstract_origin, "Type":$retType)>
@@ -326,7 +326,7 @@ def VecOp : Vec<"Vector"> {
let summary = "VectorOp";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "int":$len, "ArrayRef<Value>":$elements, "Type":$retType)>
];
}
@@ -336,7 +336,7 @@ def FieldDeclOp : FieldDecl<"field"> {
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "bool":$addressable, "bool":$used, "int":$uid, "Value":$initial,
"Value":$name, "uint64_t":$chain, "Value":$fieldOffset, "Value":$fieldBitOffset, "Type":$retType)>
];
@@ -354,7 +354,7 @@ def AddressOp : Address<"address"> {
let summary = "AddressOp";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "Value":$operand, "Type":$retType)>
];
let extraClassDeclaration = [{
@@ -367,7 +367,7 @@ def ConstructorOp : Constructor<"constructor"> {
let summary = "ConstructorOp";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "int32_t":$len, "ArrayRef<Value>":$idx, "ArrayRef<Value>":$val,
"Type":$retType)>
];
@@ -380,7 +380,7 @@ def ComponentOp : ComponentRef<"component"> {
let summary = "Component reference op";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
"Value":$component, "Value":$field, "Type":$retType)>
];
let results = (outs AnyType);
@@ -395,7 +395,7 @@ def PointerOp : Pointer<"pointer"> {
let summary = "pointer";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode,
"bool":$readOnly, "Type":$retType,
"bool":$pointerReadOnly)>
];
@@ -405,7 +405,7 @@ def MemOp : MemRef<"MemRef"> {
let summary = "Memory reference op";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
"Value":$base, "Value":$offset, "Type":$retType)>
];
let results = (outs AnyType);
@@ -420,7 +420,7 @@ def SSAOp : SSA<"SSA"> {
let summary = "SSA";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
"uint64_t":$nameVarId, "uint64_t":$ssaParmDecl, "uint64_t":$version,
"uint64_t":$definingId, "Type":$retType)>
];
@@ -430,7 +430,7 @@ def ConstOp : Constant<"constant value"> {
let summary = "const value";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
"Attribute":$init, "Type":$retType)>
];
}
@@ -439,7 +439,7 @@ def ListOp : List<"ListOp"> {
let summary = "ListOp";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
"bool":$hasPurpose, "ArrayRef<Value>":$operands, "Type":$retType)>
];
let results = (outs AnyType);
@@ -452,7 +452,7 @@ def StrOp : StringCST<"string"> {
let summary = "string";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,"StringRef":$str, "Type":$retType)>
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,"StringRef":$str, "Type":$retType)>
];
}
@@ -460,7 +460,7 @@ def ArrayOp : ArrayRef<"ArrayRef"> {
let summary = "array ref";
let description = [{TODO}];
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
+ OpBuilder<(ins "uint64_t":$id, "IDefineCode":$defCode, "bool":$readOnly,
"Value":$base, "Value":$offset, "Type":$retType)>
];
let results = (outs AnyType);
@@ -477,7 +477,7 @@ def BaseOp : Plugin_Op<"statement_base", [NoSideEffect]> {
let arguments = (ins UI64Attr:$id, StrAttr:$opCode);
let results = (outs AnyType);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "StringRef":$opCode)>
+ OpBuilder<(ins "uint64_t":$id, "StringRef":$opCode)>
];
}
@@ -487,7 +487,7 @@ def DebugOp : Plugin_Op<"debug", [NoSideEffect]> {
let arguments = (ins UI64Attr:$id);
let results = (outs AnyType);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id)>
+ OpBuilder<(ins "uint64_t":$id)>
];
}
@@ -498,7 +498,7 @@ def AsmOp : Plugin_Op<"asm", [NoSideEffect]> {
Variadic<AnyType>:$operands);
let results = (outs AnyType:$result);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "StringRef":$statement, "uint32_t":$nInputs, "uint32_t":$nOutputs,
+ OpBuilder<(ins "uint64_t":$id, "StringRef":$statement, "uint32_t":$nInputs, "uint32_t":$nOutputs,
"uint32_t":$nClobbers, "ArrayRef<Value>":$operands)>
];
@@ -519,7 +519,7 @@ def LabelOp : Plugin_Op<"label", [NoSideEffect]> {
let results = (outs AnyType:$result);
let arguments = (ins UI64Attr:$id, AnyType:$index);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "Value":$index)>
+ OpBuilder<(ins "uint64_t":$id, "Value":$index)>
];
let extraClassDeclaration = [{
Value GetLabelLabel() { return this->getOperation()->getOperand(0); };
@@ -532,7 +532,7 @@ def EHMntOp : Plugin_Op<"eh_mnt", [NoSideEffect]> {
let results = (outs AnyType:$result);
let arguments = (ins UI64Attr:$id, AnyType:$decl);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "Value":$decl)>
+ OpBuilder<(ins "uint64_t":$id, "Value":$decl)>
];
let extraClassDeclaration = [{
Value Getfndecl() { return decl(); };
@@ -545,7 +545,7 @@ def BindOp : Plugin_Op<"Bind", [NoSideEffect]> {
let results = (outs AnyType:$result);
let arguments = (ins UI64Attr:$id, AnyType:$vars, ArrayAttr:$body, AnyType:$block);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "Value":$vars, "ArrayRef<uint64_t>":$body, "Value":$block)>
+ OpBuilder<(ins "uint64_t":$id, "Value":$vars, "ArrayRef<uint64_t>":$body, "Value":$block)>
];
let extraClassDeclaration = [{
Value GetVars() { return vars(); };
@@ -559,7 +559,7 @@ def TryOp : Plugin_Op<"try", [NoSideEffect]> {
let results = (outs AnyType:$result);
let arguments = (ins UI64Attr:$id, ArrayAttr:$eval, ArrayAttr:$cleanup, UI64Attr:$kind);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "ArrayRef<uint64_t>":$eval, "ArrayRef<uint64_t>":$cleanup, "uint64_t":$kind)>
+ OpBuilder<(ins "uint64_t":$id, "ArrayRef<uint64_t>":$eval, "ArrayRef<uint64_t>":$cleanup, "uint64_t":$kind)>
];
}
@@ -569,7 +569,7 @@ def CatchOp : Plugin_Op<"catch", [NoSideEffect]> {
let results = (outs AnyType:$result);
let arguments = (ins UI64Attr:$id, AnyType:$types, ArrayAttr:$handler);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "Value":$types, "ArrayRef<uint64_t>":$handler)>
+ OpBuilder<(ins "uint64_t":$id, "Value":$types, "ArrayRef<uint64_t>":$handler)>
];
let extraClassDeclaration = [{
Value GetTypes() { return types(); };
@@ -578,7 +578,7 @@ def CatchOp : Plugin_Op<"catch", [NoSideEffect]> {
// Terminators
// Opaque builder used for terminator operations that contain successors.
-class Plugin_TerminatorOp<string mnemonic, list<OpTrait> traits = []> :
+class Plugin_TerminatorOp<string mnemonic, list<Trait> traits = []> :
Plugin_Op<mnemonic, !listconcat(traits, [Terminator])>;
def SwitchOp : Plugin_TerminatorOp<"switch", [NoSideEffect]> {
@@ -592,7 +592,7 @@ def SwitchOp : Plugin_TerminatorOp<"switch", [NoSideEffect]> {
UI64Attr:$defaultaddr, ArrayAttr:$caseaddrs);
let results = (outs AnyType:$result);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "Value":$index, "uint64_t":$address, "Value":$defaultLabel,
+ OpBuilder<(ins "uint64_t":$id, "Value":$index, "uint64_t":$address, "Value":$defaultLabel,
"ArrayRef<Value>":$operands, "Block*":$defaultDestination, "uint64_t":$defaultaddr,
"ArrayRef<Block*>":$caseDestinations, "ArrayRef<uint64_t>":$caseaddrs)>
];
@@ -612,7 +612,7 @@ def FallThroughOp : Plugin_TerminatorOp<"fallthrough", [NoSideEffect]> {
let arguments = (ins UI64Attr:$address, UI64Attr:$destaddr);
let results = (outs AnyType);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$address, "Block*":$dest, "uint64_t":$destaddr)>
+ OpBuilder<(ins "uint64_t":$address, "Block*":$dest, "uint64_t":$destaddr)>
];
}
@@ -627,7 +627,7 @@ def CondOp : Plugin_TerminatorOp<"condition", [NoSideEffect]> {
OptionalAttr<TypeAttr>:$falseLabel);
let successors = (successor AnySuccessor:$tb, AnySuccessor:$fb);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint64_t":$address, "IComparisonCode":$condCode,
+ OpBuilder<(ins "uint64_t":$id, "uint64_t":$address, "IComparisonCode":$condCode,
"Value":$lhs, "Value":$rhs, "Block*":$tb, "Block*":$fb,
"uint64_t":$tbaddr, "uint64_t":$fbaddr, "Value":$trueLabel,
"Value":$falseLabel)>
@@ -645,7 +645,7 @@ def RetOp : Plugin_TerminatorOp<"ret", [NoSideEffect]> {
let arguments = (ins UI64Attr:$address); // for bb address
let results = (outs AnyType);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$address)>
+ OpBuilder<(ins "uint64_t":$address)>
];
}
@@ -656,7 +656,7 @@ def GotoOp : Plugin_TerminatorOp<"goto", [NoSideEffect]> {
let results = (outs AnyType);
let successors = (successor AnySuccessor:$success);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint64_t":$address, "Value":$dest, "Block*":$success, "uint64_t":$successaddr)>
+ OpBuilder<(ins "uint64_t":$id, "uint64_t":$address, "Value":$dest, "Block*":$success, "uint64_t":$successaddr)>
];
let extraClassDeclaration = [{
@@ -672,7 +672,7 @@ def TransactionOp : Plugin_TerminatorOp<"transaction", [NoSideEffect]> {
let results = (outs AnyType);
let successors = (successor AnySuccessor:$fallthrough, AnySuccessor:$abort);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint64_t":$address, "ArrayRef<uint64_t>":$stmtaddr, "Value":$labelNorm,
+ OpBuilder<(ins "uint64_t":$id, "uint64_t":$address, "ArrayRef<uint64_t>":$stmtaddr, "Value":$labelNorm,
"Value":$labelUninst, "Value":$labelOver, "Block*":$fallthrough, "uint64_t":$fallthroughaddr,
"Block*":$abort, "uint64_t":$abortaddr)>
];
@@ -690,7 +690,7 @@ def ResxOp : Plugin_TerminatorOp<"resx", [NoSideEffect]> {
let arguments = (ins UI64Attr:$id, UI64Attr:$address, UI64Attr:$region);
let results = (outs AnyType);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint64_t":$address, "uint64_t":$region)>
+ OpBuilder<(ins "uint64_t":$id, "uint64_t":$address, "uint64_t":$region)>
];
let extraClassDeclaration = [{
uint64_t GetTransactionNormal() { return region(); }
@@ -704,11 +704,11 @@ def EHDispatchOp : Plugin_TerminatorOp<"dispatch", [NoSideEffect]> {
let results = (outs AnyType);
let successors = (successor VariadicSuccessor<AnySuccessor>:$ehHandlers);
let builders = [
- OpBuilderDAG<(ins "uint64_t":$id, "uint64_t":$address, "uint64_t":$region, "ArrayRef<Block*>":$ehHandlers,
+ OpBuilder<(ins "uint64_t":$id, "uint64_t":$address, "uint64_t":$region, "ArrayRef<Block*>":$ehHandlers,
"ArrayRef<uint64_t>":$ehHandlersaddrs)>
];
let extraClassDeclaration = [{
uint64_t GetTransactionNormal() { return region(); }
}];
}
-#endif // PLUGIN_OPS_TD
\ No newline at end of file
+#endif // PLUGIN_OPS_TD
diff --git a/include/Dialect/PluginTypes.h b/include/Dialect/PluginTypes.h
index 081b35b..3603798 100644
--- a/include/Dialect/PluginTypes.h
+++ b/include/Dialect/PluginTypes.h
@@ -29,6 +29,7 @@
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/MLIRContext.h"
+#include "mlir/IR/TypeSupport.h"
#include "mlir/IR/Types.h"
namespace PluginIR {
@@ -222,4 +223,4 @@ public:
} // namespace PluginIR
-#endif // MLIR_DIALECT_PLUGINIR_PLUGINTYPES_H_
\ No newline at end of file
+#endif // MLIR_DIALECT_PLUGINIR_PLUGINTYPES_H_
diff --git a/lib/Dialect/PluginDialect.cpp b/lib/Dialect/PluginDialect.cpp
index 460aa4d..86758e1 100644
--- a/lib/Dialect/PluginDialect.cpp
+++ b/lib/Dialect/PluginDialect.cpp
@@ -29,25 +29,19 @@
using namespace mlir;
using namespace mlir::Plugin;
+#include "Dialect/PluginOpsDialect.cpp.inc"
+#include "Dialect/PluginOpsEnums.cpp.inc"
+
// ===----------------------------------------------------------------------===//
// Plugin dialect.
// ===----------------------------------------------------------------------===//
void PluginDialect::initialize()
{
- addTypes<PluginIR::PluginIntegerType,
- PluginIR::PluginFloatType,
- PluginIR::PluginPointerType,
- PluginIR::PluginArrayType,
- PluginIR::PluginVectorType,
- PluginIR::PluginFunctionType,
- PluginIR::PluginStructType,
- PluginIR::PluginBooleanType,
- PluginIR::PluginVoidType,
- PluginIR::PluginUndefType>();
+ registerTypes();
addOperations<
#define GET_OP_LIST
#include "Dialect/PluginOps.cpp.inc"
>();
-}
\ No newline at end of file
+}
diff --git a/lib/Dialect/PluginOps.cpp b/lib/Dialect/PluginOps.cpp
index ec8286a..d4eca75 100644
--- a/lib/Dialect/PluginOps.cpp
+++ b/lib/Dialect/PluginOps.cpp
@@ -356,7 +356,9 @@ void CallOp::build(OpBuilder &builder, OperationState &state,
state.addAttribute("id", builder.getI64IntegerAttr(id));
state.addAttribute("address", builder.getI64IntegerAttr(address));
state.addOperands(arguments);
- state.addAttribute("callee", builder.getSymbolRefAttr(callee));
+ //state.addAttribute("callee", builder.getSymbolRefAttr(callee));
+ state.addAttribute("callee",
+ mlir::SymbolRefAttr::get(builder.getContext(), callee));
if (retType != nullptr) state.addTypes(retType);
}
diff --git a/lib/Dialect/PluginTypes.cpp b/lib/Dialect/PluginTypes.cpp
index 6c5cb0c..5a69c68 100644
--- a/lib/Dialect/PluginTypes.cpp
+++ b/lib/Dialect/PluginTypes.cpp
@@ -26,6 +26,20 @@
using namespace mlir;
using namespace PluginIR;
+using namespace mlir::Plugin;
+
+void PluginDialect::registerTypes() {
+ addTypes<PluginIntegerType,
+ PluginFloatType,
+ PluginPointerType,
+ PluginArrayType,
+ PluginVectorType,
+ PluginFunctionType,
+ PluginStructType,
+ PluginBooleanType,
+ PluginVoidType,
+ PluginUndefType>();
+}
namespace PluginIR {
namespace Detail {
--
2.33.0.windows.2

View File

@ -1,13 +1,13 @@
Name: pin-gcc-client
Version: 0.4.1
Release: 8
Release: 9
Summary: A Pin (Plug-IN framework) client is implemented based on GCC plugin and can execute the compiler optimization pass in GCC.
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
URL: https://gitee.com/src-openeuler/pin-gcc-client
Source0: %{name}-%{version}.tar.gz
BuildRequires: gcc gcc-c++ gcc-plugin-devel cmake make pkgconfig grpc grpc-plugins grpc-devel protobuf-devel jsoncpp-devel
BuildRequires: llvm-mlir llvm-mlir-static llvm-mlir-devel llvm-devel
BuildRequires: mlir mlir-static mlir-devel llvm-devel llvm-test
Requires: gcc grpc protobuf
Patch1: 0001-Pin-gcc-client-BugFix-for-SwitchOp-change-it-to-term.patch
@ -19,7 +19,8 @@ Patch6: 0006-Pin-gcc-client-Add-GetDeclType.patch
Patch7: 0007-Pin-gcc-client-Fix-VectorType.patch
Patch8: 0008-Pin-gcc-client-Fix-struct-self-contained-CallOp-Tree.patch
Patch9: 0009-Pin-gcc-client-Fix-TreeToValue-VAR_DECL-and-ARRAY_TY.patch
Patch10: 0010-PluginClient-Fix-the-bug-during-multi-process-compil.patch
Patch10: 0010-PluginClient-Fix-the-bug-during-multi-process-compil.patch
Patch11: 0011-Pin-gcc-client-Adaptation-to-llvm15-mlir15-only-solv.patch
%description
A Pin (Plug-IN framework) client is implemented based on GCC plugin and can execute the compiler optimization pass in GCC.
@ -55,13 +56,19 @@ find %{_libdir} -type f -name "*.so" -exec strip "{}" ";"
%license LICENSE
%attr(0755,root,root) %{_libdir}/libpin_gcc_client.so
%attr(0755,root,root) %{_libdir}/libMLIRClientAPI.so
%attr(0755,root,root) %{_libdir}/libMLIRClientAPI.so.12
%attr(0755,root,root) %{_libdir}/libMLIRClientAPI.so.15
%attr(0755,root,root) %{_libdir}/libMLIRPlugin.so
%attr(0755,root,root) %{_libdir}/libMLIRPlugin.so.12
%attr(0755,root,root) %{_libdir}/libMLIRPlugin.so.15
%attr(0644,root,root) %{_bindir}/pin-gcc-client.json
%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf
%changelog
* Thu Aug 3 2023 dingguangya <dingguangya1@huawei.com> - 0.4.1-9
- Type:FIX
- ID:NA
- SUG:NA
- DESC:Adaptation to llvm15/mlir15 only solves the build problem
* Tue May 09 2023 shenbowen <shenbowen@xfusion.com> - 0.4.1-8
- Type:SPEC
- ID:NA