Compare commits
11 Commits
fb886040b0
...
9053f405ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9053f405ba | ||
|
|
ec9e6c7fc6 | ||
|
|
f5300c7704 | ||
|
|
7f248b0611 | ||
|
|
a795308f95 | ||
|
|
270bad1cda | ||
|
|
fa82ec6381 | ||
|
|
b845d1f504 | ||
|
|
2b7de02b88 | ||
|
|
fd31ba5b27 | ||
|
|
a7aeedcdd6 |
528
0011-Pin-gcc-client-Adaptation-to-llvm15-mlir15-only-solv.patch
Normal file
528
0011-Pin-gcc-client-Adaptation-to-llvm15-mlir15-only-solv.patch
Normal 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
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
From a90cb241218f32ec2da8355e74f0736d245d62a8 Mon Sep 17 00:00:00 2001
|
||||
From: dingguangya <dingguangya1@huawei.com>
|
||||
Date: Fri, 4 Aug 2023 11:15:06 +0800
|
||||
Subject: [PATCH 2/2] [Pin-gcc-client] Adaptation to gcc12 only solves the
|
||||
build problem
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index fcd737b..3ed6b28 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -50,7 +50,7 @@ execute_process(COMMAND gcc -print-file-name=plugin
|
||||
ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
include_directories(${output_var}/include)
|
||||
include_directories(include)
|
||||
-add_compile_options(-std=c++14 -Wall -fPIC -fno-rtti)
|
||||
+add_compile_options(-std=c++17 -Wall -fPIC -fno-rtti)
|
||||
|
||||
# Proto file
|
||||
get_filename_component(plg_proto "protos/plugin.proto" ABSOLUTE)
|
||||
diff --git a/cmake/common.cmake b/cmake/common.cmake
|
||||
index 3d2252e..2d97026 100644
|
||||
--- a/cmake/common.cmake
|
||||
+++ b/cmake/common.cmake
|
||||
@@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.5.1)
|
||||
|
||||
-set (CMAKE_CXX_STANDARD 14)
|
||||
+set (CMAKE_CXX_STANDARD 17)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
diff --git a/lib/Translate/GimpleToPluginOps.cpp b/lib/Translate/GimpleToPluginOps.cpp
|
||||
index 80d4e87..c358d17 100644
|
||||
--- a/lib/Translate/GimpleToPluginOps.cpp
|
||||
+++ b/lib/Translate/GimpleToPluginOps.cpp
|
||||
@@ -640,7 +640,7 @@ vector<LoopOp> GimpleToPluginOps::GetAllLoops(uint64_t funcID)
|
||||
vector<LoopOp> loops;
|
||||
enum li_flags LI = LI_FROM_INNERMOST;
|
||||
class loop *loop;
|
||||
- FOR_EACH_LOOP(loop, LI) {
|
||||
+ for (auto loop : loops_list (cfun, LI)) {
|
||||
uint64_t id = reinterpret_cast<uint64_t>(reinterpret_cast<void*>(loop));
|
||||
LoopOp pluginLoop;
|
||||
if (!id) {
|
||||
--
|
||||
2.33.0.windows.2
|
||||
|
||||
927
0013-pin-gcc-client-Add-DataFlow-APIs.patch
Normal file
927
0013-pin-gcc-client-Add-DataFlow-APIs.patch
Normal file
@ -0,0 +1,927 @@
|
||||
From 6fdbb193b91f3deae430ae6ad0fc17aec40dd720 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=E9=83=91=E6=99=A8=E5=8D=89?= <zhengchenhui1@huawei.com>
|
||||
Date: Fri, 22 Dec 2023 16:06:33 +0800
|
||||
Subject: [PATCH 4/5] [pin-gcc-client] Add DataFlow APIs.
|
||||
|
||||
---
|
||||
include/PluginAPI/BasicPluginOpsAPI.h | 18 +++
|
||||
include/PluginAPI/PluginClientAPI.h | 18 +++
|
||||
include/PluginClient/PluginClient.h | 1 +
|
||||
include/PluginClient/PluginJson.h | 4 +-
|
||||
include/Translate/GimpleToPluginOps.h | 18 +++
|
||||
lib/PluginAPI/PluginClientAPI.cpp | 80 ++++++++++
|
||||
lib/PluginClient/PluginClient.cpp | 216 ++++++++++++++++++++++++-
|
||||
lib/PluginClient/PluginJson.cpp | 32 ++++
|
||||
lib/Translate/GimpleToPluginOps.cpp | 217 +++++++++++++++++++++++++-
|
||||
lib/gccPlugin/gccPlugin.cpp | 5 +
|
||||
10 files changed, 602 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/include/PluginAPI/BasicPluginOpsAPI.h b/include/PluginAPI/BasicPluginOpsAPI.h
|
||||
index 22da8df..647c498 100644
|
||||
--- a/include/PluginAPI/BasicPluginOpsAPI.h
|
||||
+++ b/include/PluginAPI/BasicPluginOpsAPI.h
|
||||
@@ -100,6 +100,7 @@ public:
|
||||
virtual vector<std::pair<uint64_t, uint64_t> > GetLoopExits(uint64_t) = 0;
|
||||
virtual std::pair<uint64_t, uint64_t> GetLoopSingleExit(uint64_t) = 0;
|
||||
virtual LoopOp GetBlockLoopFather(uint64_t) = 0;
|
||||
+ virtual LoopOp FindCommonLoop(uint64_t, uint64_t) = 0;
|
||||
virtual PhiOp GetPhiOp(uint64_t) = 0;
|
||||
virtual CallOp GetCallOp(uint64_t) = 0;
|
||||
virtual bool SetLhsInCallOp(uint64_t, uint64_t) = 0;
|
||||
@@ -118,15 +119,32 @@ public:
|
||||
virtual PhiOp CreatePhiOp(uint64_t, uint64_t) = 0;
|
||||
virtual bool UpdateSSA() = 0;
|
||||
virtual vector<PhiOp> GetPhiOpsInsideBlock(uint64_t bb) = 0;
|
||||
+ virtual vector<uint64_t> GetOpsInsideBlock(uint64_t bb) = 0;
|
||||
virtual bool IsDomInfoAvailable() = 0;
|
||||
virtual mlir::Value GetValue(uint64_t) = 0;
|
||||
virtual void DebugValue(uint64_t) = 0;
|
||||
+ virtual void DebugOperation(uint64_t) = 0;
|
||||
+ virtual void DebugBlock(uint64_t) = 0;
|
||||
virtual mlir::Value BuildMemRef(PluginTypeBase, uint64_t, uint64_t) = 0;
|
||||
virtual void RedirectFallthroughTarget(uint64_t, uint64_t) = 0;
|
||||
virtual void RemoveEdge(uint64_t, uint64_t) = 0;
|
||||
|
||||
virtual bool IsLtoOptimize() = 0;
|
||||
virtual bool IsWholeProgram() = 0;
|
||||
+
|
||||
+ virtual bool IsVirtualOperand(uint64_t) = 0;
|
||||
+
|
||||
+ virtual void CalDominanceInfo(uint64_t, uint64_t) = 0;
|
||||
+ virtual vector<uint64_t> GetImmUseStmts(uint64_t) = 0;
|
||||
+ virtual mlir::Value GetGimpleVuse(uint64_t) = 0;
|
||||
+ virtual mlir::Value GetGimpleVdef(uint64_t) = 0;
|
||||
+ virtual vector<mlir::Value> GetSsaUseOperand(uint64_t) = 0;
|
||||
+ virtual vector<mlir::Value> GetSsaDefOperand(uint64_t) = 0;
|
||||
+ virtual vector<mlir::Value> GetPhiOrStmtUse(uint64_t) = 0;
|
||||
+ virtual vector<mlir::Value> GetPhiOrStmtDef(uint64_t) = 0;
|
||||
+ virtual bool RefsMayAlias(uint64_t, uint64_t, uint64_t) = 0;
|
||||
+ virtual bool PTIncludesDecl(uint64_t, uint64_t) = 0;
|
||||
+ virtual bool PTsIntersect(uint64_t, uint64_t) = 0;
|
||||
}; // class BasicPluginOpsAPI
|
||||
} // namespace PluginAPI
|
||||
|
||||
diff --git a/include/PluginAPI/PluginClientAPI.h b/include/PluginAPI/PluginClientAPI.h
|
||||
index 26ef71d..23fa523 100644
|
||||
--- a/include/PluginAPI/PluginClientAPI.h
|
||||
+++ b/include/PluginAPI/PluginClientAPI.h
|
||||
@@ -92,6 +92,7 @@ public:
|
||||
vector<std::pair<uint64_t, uint64_t> > GetLoopExits(uint64_t) override;
|
||||
std::pair<uint64_t, uint64_t> GetLoopSingleExit(uint64_t) override;
|
||||
LoopOp GetBlockLoopFather(uint64_t) override;
|
||||
+ LoopOp FindCommonLoop(uint64_t, uint64_t) override;
|
||||
PhiOp GetPhiOp(uint64_t) override;
|
||||
CallOp GetCallOp(uint64_t) override;
|
||||
/* Plugin API for CallOp. */
|
||||
@@ -110,9 +111,12 @@ public:
|
||||
mlir::Value CreateConstOp(mlir::Attribute, mlir::Type) override;
|
||||
bool UpdateSSA() override;
|
||||
vector<PhiOp> GetPhiOpsInsideBlock(uint64_t bb) override;
|
||||
+ vector<uint64_t> GetOpsInsideBlock(uint64_t bb) override;
|
||||
bool IsDomInfoAvailable() override;
|
||||
mlir::Value GetValue(uint64_t) override;
|
||||
void DebugValue(uint64_t) override;
|
||||
+ void DebugOperation(uint64_t) override;
|
||||
+ void DebugBlock(uint64_t) override;
|
||||
mlir::Value BuildMemRef(PluginIR::PluginTypeBase, uint64_t, uint64_t) override;
|
||||
|
||||
mlir::Value GetCurrentDefFromSSA(uint64_t) override;
|
||||
@@ -128,6 +132,20 @@ public:
|
||||
|
||||
bool IsLtoOptimize() override;
|
||||
bool IsWholeProgram() override;
|
||||
+
|
||||
+ bool IsVirtualOperand(uint64_t) override;
|
||||
+ /* Plugin API for Data Flow*/
|
||||
+ void CalDominanceInfo(uint64_t, uint64_t) override;
|
||||
+ virtual vector<uint64_t> GetImmUseStmts(uint64_t) override;
|
||||
+ virtual mlir::Value GetGimpleVuse(uint64_t) override;
|
||||
+ virtual mlir::Value GetGimpleVdef(uint64_t) override;
|
||||
+ virtual vector<mlir::Value> GetSsaUseOperand(uint64_t) override;
|
||||
+ virtual vector<mlir::Value> GetSsaDefOperand(uint64_t) override;
|
||||
+ virtual vector<mlir::Value> GetPhiOrStmtUse(uint64_t) override;
|
||||
+ virtual vector<mlir::Value> GetPhiOrStmtDef(uint64_t) override;
|
||||
+ virtual bool RefsMayAlias(uint64_t, uint64_t, uint64_t) override;
|
||||
+ virtual bool PTIncludesDecl(uint64_t, uint64_t) override;
|
||||
+ virtual bool PTsIntersect(uint64_t, uint64_t) override;
|
||||
private:
|
||||
PluginIR::GimpleToPluginOps gimpleConversion;
|
||||
}; // class PluginClientAPI
|
||||
diff --git a/include/PluginClient/PluginClient.h b/include/PluginClient/PluginClient.h
|
||||
index 2b5648c..0b90970 100644
|
||||
--- a/include/PluginClient/PluginClient.h
|
||||
+++ b/include/PluginClient/PluginClient.h
|
||||
@@ -117,6 +117,7 @@ enum RefPassName {
|
||||
PASS_PHIOPT,
|
||||
PASS_SSA,
|
||||
PASS_LOOP,
|
||||
+ PASS_LAD,
|
||||
PASS_MAC,
|
||||
};
|
||||
|
||||
diff --git a/include/PluginClient/PluginJson.h b/include/PluginClient/PluginJson.h
|
||||
index f8df011..a45a9b7 100755
|
||||
--- a/include/PluginClient/PluginJson.h
|
||||
+++ b/include/PluginClient/PluginJson.h
|
||||
@@ -52,7 +52,9 @@ public:
|
||||
void FunctionDeclsJsonSerialize(vector<mlir::Plugin::DeclBaseOp>& decls, string& out);
|
||||
void FiledOpsJsonSerialize(vector<mlir::Plugin::FieldDeclOp>& decls, string& out);
|
||||
void GetPhiOpsJsonSerialize(vector<mlir::Plugin::PhiOp> phiOps, string& out);
|
||||
- Json::Value OperationJsonSerialize(mlir::Operation *, uint64_t&);
|
||||
+ void OpsJsonSerialize(vector<std::pair<mlir::Operation*, uint64_t>>& ops, string& out);
|
||||
+ void ValuesJsonSerialize(vector<mlir::Value>& values, string& out);
|
||||
+ Json::Value OperationJsonSerialize(mlir::Operation*, uint64_t&);
|
||||
Json::Value CallOpJsonSerialize(mlir::Plugin::CallOp& data);
|
||||
Json::Value CondOpJsonSerialize(mlir::Plugin::CondOp& data, uint64_t&);
|
||||
Json::Value PhiOpJsonSerialize(mlir::Plugin::PhiOp& data);
|
||||
diff --git a/include/Translate/GimpleToPluginOps.h b/include/Translate/GimpleToPluginOps.h
|
||||
index 1332219..0423f15 100644
|
||||
--- a/include/Translate/GimpleToPluginOps.h
|
||||
+++ b/include/Translate/GimpleToPluginOps.h
|
||||
@@ -109,6 +109,7 @@ public:
|
||||
vector<std::pair<uint64_t, uint64_t> > GetLoopExits(uint64_t);
|
||||
std::pair<uint64_t, uint64_t> GetLoopSingleExit(uint64_t);
|
||||
LoopOp GetBlockLoopFather(uint64_t);
|
||||
+ LoopOp FindCommonLoop(uint64_t, uint64_t);
|
||||
CallOp BuildCallOp(uint64_t);
|
||||
bool SetGimpleCallLHS(uint64_t, uint64_t);
|
||||
uint32_t AddPhiArg(uint64_t, uint64_t, uint64_t, uint64_t);
|
||||
@@ -140,9 +141,12 @@ public:
|
||||
void GetTreeAttr(uint64_t, bool&, PluginTypeBase&);
|
||||
mlir::Value TreeToValue(uint64_t);
|
||||
void DebugValue(uint64_t);
|
||||
+ void DebugOperation(uint64_t);
|
||||
+ void DebugBlock(uint64_t);
|
||||
mlir::Value BuildMemRef(PluginIR::PluginTypeBase, uint64_t, uint64_t);
|
||||
bool UpdateSSA();
|
||||
vector<mlir::Plugin::PhiOp> GetPhiOpsInsideBlock(uint64_t);
|
||||
+ vector<uint64_t> GetOpsInsideBlock(uint64_t);
|
||||
bool IsDomInfoAvailable();
|
||||
mlir::Value CreateNewDefFor(uint64_t, uint64_t, uint64_t);
|
||||
bool SetCurrentDefFor(uint64_t, uint64_t);
|
||||
@@ -156,6 +160,20 @@ public:
|
||||
bool IsLtoOptimize();
|
||||
bool IsWholeProgram();
|
||||
|
||||
+ bool IsVirtualOperand(uint64_t);
|
||||
+
|
||||
+ void CalDominanceInfo(uint64_t, uint64_t);
|
||||
+ vector<uint64_t> GetImmUseStmts(uint64_t);
|
||||
+ mlir::Value GetGimpleVuse(uint64_t);
|
||||
+ mlir::Value GetGimpleVdef(uint64_t);
|
||||
+ vector<mlir::Value> GetSsaUseOperand(uint64_t);
|
||||
+ vector<mlir::Value> GetSsaDefOperand(uint64_t);
|
||||
+ vector<mlir::Value> GetPhiOrStmtUse(uint64_t);
|
||||
+ vector<mlir::Value> GetPhiOrStmtDef(uint64_t);
|
||||
+ bool RefsMayAlias(uint64_t, uint64_t, uint64_t);
|
||||
+ bool PTIncludesDecl(uint64_t, uint64_t);
|
||||
+ bool PTsIntersect(uint64_t, uint64_t);
|
||||
+
|
||||
private:
|
||||
GimpleToPluginOps () = delete;
|
||||
mlir::OpBuilder builder;
|
||||
diff --git a/lib/PluginAPI/PluginClientAPI.cpp b/lib/PluginAPI/PluginClientAPI.cpp
|
||||
index 95e9ab3..b908ba1 100644
|
||||
--- a/lib/PluginAPI/PluginClientAPI.cpp
|
||||
+++ b/lib/PluginAPI/PluginClientAPI.cpp
|
||||
@@ -274,6 +274,12 @@ LoopOp PluginClientAPI::GetBlockLoopFather(uint64_t blockId)
|
||||
{
|
||||
return gimpleConversion.GetBlockLoopFather(blockId);
|
||||
}
|
||||
+
|
||||
+LoopOp PluginClientAPI::FindCommonLoop(uint64_t opId_1, uint64_t opId_2)
|
||||
+{
|
||||
+ return gimpleConversion.FindCommonLoop(opId_1, opId_2);
|
||||
+}
|
||||
+
|
||||
PhiOp PluginClientAPI::GetPhiOp(uint64_t id)
|
||||
{
|
||||
return gimpleConversion.BuildPhiOp(id);
|
||||
@@ -345,6 +351,11 @@ vector<mlir::Plugin::PhiOp> PluginClientAPI::GetPhiOpsInsideBlock(uint64_t bb)
|
||||
return gimpleConversion.GetPhiOpsInsideBlock(bb);
|
||||
}
|
||||
|
||||
+vector<uint64_t> PluginClientAPI::GetOpsInsideBlock(uint64_t bb)
|
||||
+{
|
||||
+ return gimpleConversion.GetOpsInsideBlock(bb);
|
||||
+}
|
||||
+
|
||||
bool PluginClientAPI::IsDomInfoAvailable()
|
||||
{
|
||||
return gimpleConversion.IsDomInfoAvailable();
|
||||
@@ -380,11 +391,26 @@ mlir::Value PluginClientAPI::GetValue(uint64_t valId)
|
||||
return gimpleConversion.TreeToValue(valId);
|
||||
}
|
||||
|
||||
+bool PluginClientAPI::IsVirtualOperand(uint64_t id)
|
||||
+{
|
||||
+ return gimpleConversion.IsVirtualOperand(id);
|
||||
+}
|
||||
+
|
||||
void PluginClientAPI::DebugValue(uint64_t valId)
|
||||
{
|
||||
gimpleConversion.DebugValue(valId);
|
||||
}
|
||||
|
||||
+void PluginClientAPI::DebugOperation(uint64_t opId)
|
||||
+{
|
||||
+ gimpleConversion.DebugOperation(opId);
|
||||
+}
|
||||
+
|
||||
+void PluginClientAPI::DebugBlock(uint64_t bb)
|
||||
+{
|
||||
+ gimpleConversion.DebugBlock(bb);
|
||||
+}
|
||||
+
|
||||
mlir::Value PluginClientAPI::BuildMemRef(PluginIR::PluginTypeBase type,
|
||||
uint64_t baseId, uint64_t offsetId)
|
||||
{
|
||||
@@ -411,4 +437,58 @@ bool PluginClientAPI::IsWholeProgram()
|
||||
return gimpleConversion.IsWholeProgram();
|
||||
}
|
||||
|
||||
+void PluginClientAPI::CalDominanceInfo(uint64_t dir, uint64_t funcID)
|
||||
+{
|
||||
+ return gimpleConversion.CalDominanceInfo(dir, funcID);
|
||||
+}
|
||||
+
|
||||
+vector<uint64_t> PluginClientAPI::GetImmUseStmts(uint64_t varId)
|
||||
+{
|
||||
+ return gimpleConversion.GetImmUseStmts(varId);
|
||||
+}
|
||||
+
|
||||
+mlir::Value PluginClientAPI::GetGimpleVuse(uint64_t opId)
|
||||
+{
|
||||
+ return gimpleConversion.GetGimpleVuse(opId);
|
||||
+}
|
||||
+
|
||||
+mlir::Value PluginClientAPI::GetGimpleVdef(uint64_t opId)
|
||||
+{
|
||||
+ return gimpleConversion.GetGimpleVdef(opId);
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> PluginClientAPI::GetSsaUseOperand(uint64_t opId)
|
||||
+{
|
||||
+ return gimpleConversion.GetSsaUseOperand(opId);
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> PluginClientAPI::GetSsaDefOperand(uint64_t opId)
|
||||
+{
|
||||
+ return gimpleConversion.GetSsaDefOperand(opId);
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> PluginClientAPI::GetPhiOrStmtUse(uint64_t opId)
|
||||
+{
|
||||
+ return gimpleConversion.GetPhiOrStmtUse(opId);
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> PluginClientAPI::GetPhiOrStmtDef(uint64_t opId)
|
||||
+{
|
||||
+ return gimpleConversion.GetPhiOrStmtDef(opId);
|
||||
+}
|
||||
+
|
||||
+bool PluginClientAPI::RefsMayAlias(uint64_t id1, uint64_t id2, uint64_t flag)
|
||||
+{
|
||||
+ return gimpleConversion.RefsMayAlias(id1, id2, flag);
|
||||
+}
|
||||
+
|
||||
+bool PluginClientAPI::PTIncludesDecl(uint64_t ptrId, uint64_t declId)
|
||||
+{
|
||||
+ return gimpleConversion.PTIncludesDecl(ptrId, declId);
|
||||
+}
|
||||
+
|
||||
+bool PluginClientAPI::PTsIntersect(uint64_t ptrId_1, uint64_t ptrId_2)
|
||||
+{
|
||||
+ return gimpleConversion.PTsIntersect(ptrId_1, ptrId_2);
|
||||
+}
|
||||
} // namespace PluginAPI
|
||||
\ No newline at end of file
|
||||
diff --git a/lib/PluginClient/PluginClient.cpp b/lib/PluginClient/PluginClient.cpp
|
||||
index c9f3cb7..fba0de4 100644
|
||||
--- a/lib/PluginClient/PluginClient.cpp
|
||||
+++ b/lib/PluginClient/PluginClient.cpp
|
||||
@@ -839,6 +839,19 @@ void GetBlockLoopFatherResult(PluginClient *client, Json::Value& root, string& r
|
||||
client->ReceiveSendMsg("LoopOpResult", result);
|
||||
}
|
||||
|
||||
+void FindCommonLoopResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ uint64_t loopId_1 = atol(root["loopId_1"].asString().c_str());
|
||||
+ uint64_t loopId_2 = atol(root["loopId_2"].asString().c_str());
|
||||
+ LoopOp commonLoop = clientAPI.FindCommonLoop(loopId_1, loopId_2);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.LoopOpJsonSerialize(commonLoop, result);
|
||||
+ client->ReceiveSendMsg("LoopOpResult", result);
|
||||
+}
|
||||
+
|
||||
void CreateBlockResult(PluginClient *client, Json::Value& root, string& result)
|
||||
{
|
||||
/// Json格式
|
||||
@@ -942,7 +955,7 @@ void GetPhiOpResult(PluginClient *client, Json::Value& root, string& result)
|
||||
PhiOp op = clientAPI.GetPhiOp(id);
|
||||
PluginJson json = client->GetJson();
|
||||
Json::Value phiOpResult = json.PhiOpJsonSerialize(op);
|
||||
- client->ReceiveSendMsg("OpsResult", phiOpResult.toStyledString());
|
||||
+ client->ReceiveSendMsg("OpResult", phiOpResult.toStyledString());
|
||||
}
|
||||
|
||||
void GetCallOpResult(PluginClient *client, Json::Value& root, string& result)
|
||||
@@ -954,7 +967,7 @@ void GetCallOpResult(PluginClient *client, Json::Value& root, string& result)
|
||||
CallOp op = clientAPI.GetCallOp(id);
|
||||
PluginJson json = client->GetJson();
|
||||
Json::Value opResult = json.CallOpJsonSerialize(op);
|
||||
- client->ReceiveSendMsg("OpsResult", opResult.toStyledString());
|
||||
+ client->ReceiveSendMsg("OpResult", opResult.toStyledString());
|
||||
}
|
||||
|
||||
void SetLhsInCallOpResult(PluginClient *client, Json::Value& root, string& result)
|
||||
@@ -1068,7 +1081,7 @@ void CreatePhiOpResult(PluginClient *client, Json::Value& root, string& result)
|
||||
PhiOp op = clientAPI.CreatePhiOp(argId, blockId);
|
||||
PluginJson json = client->GetJson();
|
||||
Json::Value opResult = json.PhiOpJsonSerialize(op);
|
||||
- client->ReceiveSendMsg("OpsResult", opResult.toStyledString());
|
||||
+ client->ReceiveSendMsg("OpResult", opResult.toStyledString());
|
||||
}
|
||||
|
||||
void CreateConstOpResult(PluginClient *client, Json::Value& root, string& result)
|
||||
@@ -1106,6 +1119,18 @@ void GetAllPhiOpInsideBlockResult(PluginClient *client, Json::Value& root, strin
|
||||
client->ReceiveSendMsg("GetPhiOps", result);
|
||||
}
|
||||
|
||||
+void GetAllOpsInsideBlockResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ uint64_t bb = atol(root["bbAddr"].asString().c_str());
|
||||
+ vector<uint64_t> opsId = clientAPI.GetOpsInsideBlock(bb);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.IDsJsonSerialize(opsId, result);
|
||||
+ client->ReceiveSendMsg("IdsResult", result);
|
||||
+}
|
||||
+
|
||||
void IsDomInfoAvailableResult(PluginClient *client, Json::Value& root, string& result)
|
||||
{
|
||||
mlir::MLIRContext context;
|
||||
@@ -1172,6 +1197,136 @@ void CreateNewDefResult(PluginClient *client, Json::Value& root, string& result)
|
||||
client->ReceiveSendMsg("ValueResult", json.ValueJsonSerialize(ret).toStyledString());
|
||||
}
|
||||
|
||||
+void CalDominanceInfoResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ std::string dirIdKey = "dir";
|
||||
+ uint64_t dir = atol(root[dirIdKey].asString().c_str());
|
||||
+ uint64_t funcId = atol(root["funcId"].asString().c_str());
|
||||
+ clientAPI.CalDominanceInfo(dir, funcId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.NopJsonSerialize(result);
|
||||
+ client->ReceiveSendMsg("VoidResult", result);
|
||||
+}
|
||||
+
|
||||
+void GetImmUseStmtsResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t varId = atol(root["varId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ vector<uint64_t> opsId = clientAPI.GetImmUseStmts(varId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.IDsJsonSerialize(opsId, result);
|
||||
+ client->ReceiveSendMsg("IdsResult", result);
|
||||
+}
|
||||
+
|
||||
+void GetGimpleVuseResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t opId = atol(root["opId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ mlir::Value vuse = clientAPI.GetGimpleVuse(opId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ client->ReceiveSendMsg("ValueResult", json.ValueJsonSerialize(vuse).toStyledString());
|
||||
+}
|
||||
+
|
||||
+void GetGimpleVdefResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t opId = atol(root["opId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ mlir::Value vdef = clientAPI.GetGimpleVdef(opId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ client->ReceiveSendMsg("ValueResult", json.ValueJsonSerialize(vdef).toStyledString());
|
||||
+}
|
||||
+
|
||||
+void GetSsaUseOperandResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t opId = atol(root["opId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ vector<mlir::Value> ret = clientAPI.GetSsaUseOperand(opId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.ValuesJsonSerialize(ret, result);
|
||||
+ client->ReceiveSendMsg("ValuesResult", result);
|
||||
+}
|
||||
+
|
||||
+void GetSsaDefOperandResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t opId = atol(root["opId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ vector<mlir::Value> ret = clientAPI.GetSsaDefOperand(opId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.ValuesJsonSerialize(ret, result);
|
||||
+ client->ReceiveSendMsg("ValuesResult", result);
|
||||
+}
|
||||
+
|
||||
+void GetPhiOrStmtUseResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t opId = atol(root["opId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ vector<mlir::Value> ret = clientAPI.GetPhiOrStmtUse(opId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.ValuesJsonSerialize(ret, result);
|
||||
+ client->ReceiveSendMsg("ValuesResult", result);
|
||||
+}
|
||||
+
|
||||
+void GetPhiOrStmtDefResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t opId = atol(root["opId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ vector<mlir::Value> ret = clientAPI.GetPhiOrStmtDef(opId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.ValuesJsonSerialize(ret, result);
|
||||
+ client->ReceiveSendMsg("ValuesResult", result);
|
||||
+}
|
||||
+
|
||||
+void RefsMayAliasResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t id1 = atol(root["id1"].asString().c_str());
|
||||
+ uint64_t id2 = atol(root["id2"].asString().c_str());
|
||||
+ uint64_t flag = atol(root["flag"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ bool ret = clientAPI.RefsMayAlias(id1, id2, flag);
|
||||
+ client->ReceiveSendMsg("BoolResult", std::to_string(ret));
|
||||
+}
|
||||
+
|
||||
+void PTIncludesDeclResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t ptrId = atol(root["ptrId"].asString().c_str());
|
||||
+ uint64_t declId = atol(root["declId"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ bool ret = clientAPI.PTIncludesDecl(ptrId, declId);
|
||||
+ client->ReceiveSendMsg("BoolResult", std::to_string(ret));
|
||||
+}
|
||||
+
|
||||
+void PTsIntersectResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t ptrId_1 = atol(root["ptrId_1"].asString().c_str());
|
||||
+ uint64_t ptrId_2 = atol(root["ptrId_2"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ bool ret = clientAPI.PTsIntersect(ptrId_1, ptrId_2);
|
||||
+ client->ReceiveSendMsg("BoolResult", std::to_string(ret));
|
||||
+}
|
||||
+
|
||||
void RemoveEdgeResult(PluginClient *client, Json::Value& root, string& result)
|
||||
{
|
||||
/// Json格式
|
||||
@@ -1235,6 +1390,16 @@ void BuildMemRefResult(PluginClient *client, Json::Value& root, string& result)
|
||||
client->ReceiveSendMsg("ValueResult", result);
|
||||
}
|
||||
|
||||
+void IsVirtualOperandResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ uint64_t id = atol(root["id"].asString().c_str());
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ bool ret = clientAPI.IsVirtualOperand(id);
|
||||
+ client->ReceiveSendMsg("BoolResult", std::to_string(ret));
|
||||
+}
|
||||
+
|
||||
void DebugValueResult(PluginClient *client, Json::Value& root, string& result)
|
||||
{
|
||||
/// Json格式
|
||||
@@ -1252,6 +1417,31 @@ void DebugValueResult(PluginClient *client, Json::Value& root, string& result)
|
||||
client->ReceiveSendMsg("ValueResult", result);
|
||||
}
|
||||
|
||||
+void DebugOperationResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ std::string opIdKey = "opId";
|
||||
+ uint64_t opId = atol(root[opIdKey].asString().c_str());
|
||||
+ clientAPI.DebugOperation(opId);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.NopJsonSerialize(result);
|
||||
+ client->ReceiveSendMsg("VoidResult", result);
|
||||
+}
|
||||
+
|
||||
+void DebugBlockResult(PluginClient *client, Json::Value& root, string& result)
|
||||
+{
|
||||
+ mlir::MLIRContext context;
|
||||
+ context.getOrLoadDialect<PluginDialect>();
|
||||
+ PluginAPI::PluginClientAPI clientAPI(context);
|
||||
+ uint64_t bb = atol(root["bbAddr"].asString().c_str());
|
||||
+ clientAPI.DebugBlock(bb);
|
||||
+ PluginJson json = client->GetJson();
|
||||
+ json.NopJsonSerialize(result);
|
||||
+ client->ReceiveSendMsg("VoidResult", result);
|
||||
+}
|
||||
+
|
||||
void IsLtoOptimizeResult(PluginClient *client, Json::Value& root, string& result)
|
||||
{
|
||||
mlir::MLIRContext context;
|
||||
@@ -1314,6 +1504,7 @@ std::map<string, GetResultFunc> g_getResultFunc = {
|
||||
{"GetLoopExits", GetLoopExitsResult},
|
||||
{"GetLoopSingleExit", GetLoopSingleExitResult},
|
||||
{"GetBlockLoopFather", GetBlockLoopFatherResult},
|
||||
+ {"FindCommonLoop", FindCommonLoopResult},
|
||||
{"CreateBlock", CreateBlockResult},
|
||||
{"DeleteBlock", DeleteBlockResult},
|
||||
{"SetImmediateDominator", SetImmediateDominatorResult},
|
||||
@@ -1332,6 +1523,7 @@ std::map<string, GetResultFunc> g_getResultFunc = {
|
||||
{"CreateConstOp", CreateConstOpResult},
|
||||
{"UpdateSSA", UpdateSSAResult},
|
||||
{"GetAllPhiOpInsideBlock", GetAllPhiOpInsideBlockResult},
|
||||
+ {"GetAllOpsInsideBlock", GetAllOpsInsideBlockResult},
|
||||
{"IsDomInfoAvailable", IsDomInfoAvailableResult},
|
||||
{"GetCurrentDefFromSSA", GetCurrentDefFromSSAResult},
|
||||
{"SetCurrentDefInSSA", SetCurrentDefInSSAResult},
|
||||
@@ -1341,9 +1533,23 @@ std::map<string, GetResultFunc> g_getResultFunc = {
|
||||
{"RemoveEdge", RemoveEdgeResult},
|
||||
{"ConfirmValue", ConfirmValueResult},
|
||||
{"BuildMemRef", BuildMemRefResult},
|
||||
+ {"IsVirtualOperand", IsVirtualOperandResult},
|
||||
{"DebugValue", DebugValueResult},
|
||||
- {"IsLtoOptimize",IsLtoOptimizeResult},
|
||||
- {"IsWholeProgram",IsWholeProgramResult},
|
||||
+ {"DebugOperation", DebugOperationResult},
|
||||
+ {"DebugBlock", DebugBlockResult},
|
||||
+ {"IsLtoOptimize", IsLtoOptimizeResult},
|
||||
+ {"IsWholeProgram", IsWholeProgramResult},
|
||||
+ {"CalDominanceInfo", CalDominanceInfoResult},
|
||||
+ {"GetImmUseStmts", GetImmUseStmtsResult},
|
||||
+ {"GetGimpleVuse", GetGimpleVuseResult},
|
||||
+ {"GetGimpleVdef", GetGimpleVdefResult},
|
||||
+ {"GetSsaUseOperand", GetSsaUseOperandResult},
|
||||
+ {"GetSsaDefOperand", GetSsaDefOperandResult},
|
||||
+ {"GetPhiOrStmtUse", GetPhiOrStmtUseResult},
|
||||
+ {"GetPhiOrStmtDef", GetPhiOrStmtDefResult},
|
||||
+ {"RefsMayAlias", RefsMayAliasResult},
|
||||
+ {"PTIncludesDecl", PTIncludesDeclResult},
|
||||
+ {"PTsIntersect", PTsIntersectResult}
|
||||
};
|
||||
|
||||
void PluginClient::GetIRTransResult(void *gccData, const string& funcName, const string& param)
|
||||
diff --git a/lib/PluginClient/PluginJson.cpp b/lib/PluginClient/PluginJson.cpp
|
||||
index 7384a49..70532df 100755
|
||||
--- a/lib/PluginClient/PluginJson.cpp
|
||||
+++ b/lib/PluginClient/PluginJson.cpp
|
||||
@@ -444,6 +444,38 @@ void PluginJson::LoopOpJsonSerialize(mlir::Plugin::LoopOp& loop, string& out)
|
||||
out = root.toStyledString();
|
||||
}
|
||||
|
||||
+void PluginJson::OpsJsonSerialize(vector<std::pair<mlir::Operation*, uint64_t>>& ops, string& out)
|
||||
+{
|
||||
+ Json::Value root;
|
||||
+ Json::Value item;
|
||||
+ int i = 0;
|
||||
+ string index;
|
||||
+
|
||||
+ for (auto& op : ops) {
|
||||
+ item = OperationJsonSerialize(op.first, op.second);
|
||||
+ index = "Op" + std::to_string(i++);
|
||||
+ root[index] = item;
|
||||
+ item.clear();
|
||||
+ }
|
||||
+ out = root.toStyledString();
|
||||
+}
|
||||
+
|
||||
+void PluginJson::ValuesJsonSerialize(vector<mlir::Value>& values, string& out)
|
||||
+{
|
||||
+ Json::Value root;
|
||||
+ Json::Value item;
|
||||
+ int i = 0;
|
||||
+ string index;
|
||||
+
|
||||
+ for (auto& v : values) {
|
||||
+ item = ValueJsonSerialize(v);
|
||||
+ index = "Value" + std::to_string(i++);
|
||||
+ root[index] = item;
|
||||
+ item.clear();
|
||||
+ }
|
||||
+ out = root.toStyledString();
|
||||
+}
|
||||
+
|
||||
void PluginJson::IDsJsonSerialize(vector<uint64_t>& ids, string& out)
|
||||
{
|
||||
Json::Value root;
|
||||
diff --git a/lib/Translate/GimpleToPluginOps.cpp b/lib/Translate/GimpleToPluginOps.cpp
|
||||
index c358d17..342ef3d 100644
|
||||
--- a/lib/Translate/GimpleToPluginOps.cpp
|
||||
+++ b/lib/Translate/GimpleToPluginOps.cpp
|
||||
@@ -49,6 +49,8 @@
|
||||
#include "dominance.h"
|
||||
#include "print-tree.h"
|
||||
#include "stor-layout.h"
|
||||
+#include "ssa-iterators.h"
|
||||
+#include <iostream>
|
||||
|
||||
namespace PluginIR {
|
||||
using namespace mlir::Plugin;
|
||||
@@ -754,7 +756,7 @@ void GimpleToPluginOps::SetLatch(uint64_t loopID, uint64_t blockID)
|
||||
vector<std::pair<uint64_t, uint64_t> > GimpleToPluginOps::GetLoopExits(uint64_t loopID)
|
||||
{
|
||||
class loop *loop = reinterpret_cast<class loop *>(loopID);
|
||||
- vec<edge> exit_edges = get_loop_exit_edges(loop);
|
||||
+ auto_vec<edge> exit_edges = get_loop_exit_edges(loop);
|
||||
edge e;
|
||||
unsigned i = 0;
|
||||
vector<std::pair<uint64_t, uint64_t> > res;
|
||||
@@ -789,6 +791,22 @@ LoopOp GimpleToPluginOps::GetBlockLoopFather(uint64_t blockID)
|
||||
return pluginLoop;
|
||||
}
|
||||
|
||||
+LoopOp GimpleToPluginOps::FindCommonLoop(uint64_t loopId_1, uint64_t loopId_2)
|
||||
+{
|
||||
+ class loop *loop_s = reinterpret_cast<class loop *>(loopId_1);
|
||||
+ class loop *loop_d = reinterpret_cast<class loop *>(loopId_2);
|
||||
+ class loop *loop = find_common_loop(loop_s, loop_d);
|
||||
+ LoopOp pluginLoop;
|
||||
+ auto location = builder.getUnknownLoc();
|
||||
+ uint64_t id = reinterpret_cast<uint64_t>(loop);
|
||||
+ uint32_t index = (uint32_t)loop->num;
|
||||
+ uint64_t innerLoopId = reinterpret_cast<uint64_t>(reinterpret_cast<void*>(loop->inner));
|
||||
+ uint64_t outerLoopId = reinterpret_cast<uint64_t>(reinterpret_cast<void*>(loop_outer(loop)));
|
||||
+ uint32_t numBlock = loop->num_nodes;
|
||||
+ pluginLoop = builder.create<LoopOp>(location, id, index, innerLoopId, outerLoopId, numBlock);
|
||||
+ return pluginLoop;
|
||||
+}
|
||||
+
|
||||
void GimpleToPluginOps::RedirectFallthroughTarget(uint64_t src, uint64_t dest)
|
||||
{
|
||||
basic_block srcbb = reinterpret_cast<basic_block>(reinterpret_cast<void*>(src));
|
||||
@@ -1721,6 +1739,19 @@ Value GimpleToPluginOps::TreeToValue(uint64_t treeId)
|
||||
void GimpleToPluginOps::DebugValue(uint64_t valId)
|
||||
{
|
||||
tree t = reinterpret_cast<tree>(valId);
|
||||
+ debug_tree(t);
|
||||
+}
|
||||
+
|
||||
+void GimpleToPluginOps::DebugOperation(uint64_t opId)
|
||||
+{
|
||||
+ gimple *stmt = reinterpret_cast<gimple*>(opId);
|
||||
+ debug_gimple_stmt(stmt);
|
||||
+}
|
||||
+
|
||||
+void GimpleToPluginOps::DebugBlock(uint64_t bb)
|
||||
+{
|
||||
+ basic_block BB = reinterpret_cast<basic_block>(bb);
|
||||
+ debug_bb(BB);
|
||||
}
|
||||
|
||||
mlir::Value GimpleToPluginOps::BuildMemRef(PluginIR::PluginTypeBase type, uint64_t baseId, uint64_t offsetId)
|
||||
@@ -1828,6 +1859,27 @@ vector<PhiOp> GimpleToPluginOps::GetPhiOpsInsideBlock(uint64_t bb)
|
||||
return phiOps;
|
||||
}
|
||||
|
||||
+vector<uint64_t> GimpleToPluginOps::GetOpsInsideBlock(uint64_t bb)
|
||||
+{
|
||||
+ basic_block header = reinterpret_cast<basic_block>(bb);
|
||||
+ vector<uint64_t> ops;
|
||||
+ gimple_stmt_iterator gsi;
|
||||
+ int i = 0;
|
||||
+ for (gsi = gsi_start_bb (header);
|
||||
+ !gsi_end_p (gsi);
|
||||
+ gsi_next (&gsi))
|
||||
+ {
|
||||
+ gimple *s = gsi_stmt(gsi);
|
||||
+ if (gimple_code(s) == GIMPLE_DEBUG) continue;
|
||||
+ uint64_t id = reinterpret_cast<uint64_t>(reinterpret_cast<void*>(s));
|
||||
+ if (gimple_code(s) == GIMPLE_ASSIGN) {
|
||||
+ BuildAssignOp(id);
|
||||
+ }
|
||||
+ ops.push_back(id);
|
||||
+ }
|
||||
+ return ops;
|
||||
+}
|
||||
+
|
||||
bool GimpleToPluginOps::IsDomInfoAvailable()
|
||||
{
|
||||
return dom_info_available_p (CDI_DOMINATORS);
|
||||
@@ -1887,4 +1939,167 @@ Value GimpleToPluginOps::MakeSsaName(mlir::Type type)
|
||||
return TreeToValue(retId);
|
||||
}
|
||||
|
||||
+bool GimpleToPluginOps::IsVirtualOperand(uint64_t id)
|
||||
+{
|
||||
+ tree op = reinterpret_cast<tree>(id);
|
||||
+ return virtual_operand_p (op);
|
||||
+}
|
||||
+
|
||||
+void GimpleToPluginOps::CalDominanceInfo(uint64_t dir, uint64_t funcID)
|
||||
+{
|
||||
+ function *fn = reinterpret_cast<function *>(funcID);
|
||||
+ push_cfun(fn);
|
||||
+ if (dir == 1) {
|
||||
+ calculate_dominance_info(CDI_DOMINATORS);
|
||||
+ } else if (dir == 2) {
|
||||
+ calculate_dominance_info(CDI_POST_DOMINATORS);
|
||||
+ } else {
|
||||
+ abort();
|
||||
+ }
|
||||
+ pop_cfun();
|
||||
+}
|
||||
+
|
||||
+vector<uint64_t> GimpleToPluginOps::GetImmUseStmts(uint64_t varId)
|
||||
+{
|
||||
+ vector<uint64_t> opsId;
|
||||
+ tree var = reinterpret_cast<tree>(varId);
|
||||
+ imm_use_iterator imm_iter;
|
||||
+ gimple *stmt;
|
||||
+ FOR_EACH_IMM_USE_STMT (stmt, imm_iter, var) {
|
||||
+ uint64_t id = reinterpret_cast<uint64_t>(reinterpret_cast<void*>(stmt));
|
||||
+ opsId.push_back(id);
|
||||
+ }
|
||||
+ return opsId;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+mlir::Value GimpleToPluginOps::GetGimpleVuse(uint64_t opId)
|
||||
+{
|
||||
+ gimple *stmt = reinterpret_cast<gimple*>(opId);
|
||||
+ tree vuse = gimple_vuse(stmt);
|
||||
+ mlir::Value v = TreeToValue(reinterpret_cast<uint64_t>(reinterpret_cast<void*>(vuse)));
|
||||
+ return v;
|
||||
+}
|
||||
+
|
||||
+mlir::Value GimpleToPluginOps::GetGimpleVdef(uint64_t opId)
|
||||
+{
|
||||
+ gimple *stmt = reinterpret_cast<gimple*>(opId);
|
||||
+ tree vdef = gimple_vdef(stmt);
|
||||
+ mlir::Value v = TreeToValue(reinterpret_cast<uint64_t>(reinterpret_cast<void*>(vdef)));
|
||||
+ return v;
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> GimpleToPluginOps::GetSsaUseOperand(uint64_t opId)
|
||||
+{
|
||||
+ vector<mlir::Value> ret;
|
||||
+ gimple *stmt = reinterpret_cast<gimple*>(opId);
|
||||
+ use_operand_p use_p;
|
||||
+ ssa_op_iter oi;
|
||||
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, oi, SSA_OP_USE) {
|
||||
+ tree op = USE_FROM_PTR (use_p);
|
||||
+ if (TREE_CODE (op) != SSA_NAME) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ mlir::Value v = TreeToValue(reinterpret_cast<uint64_t>(reinterpret_cast<void*>(op)));
|
||||
+ ret.push_back(v);
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> GimpleToPluginOps::GetSsaDefOperand(uint64_t opId)
|
||||
+{
|
||||
+ vector<mlir::Value> ret;
|
||||
+ gimple *stmt = reinterpret_cast<gimple*>(opId);
|
||||
+ def_operand_p def_p;
|
||||
+ ssa_op_iter oi;
|
||||
+ FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, oi, SSA_OP_DEF) {
|
||||
+ tree op = DEF_FROM_PTR (def_p);
|
||||
+ if (TREE_CODE (op) != SSA_NAME) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ mlir::Value v = TreeToValue(reinterpret_cast<uint64_t>(reinterpret_cast<void*>(op)));
|
||||
+ ret.push_back(v);
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> GimpleToPluginOps::GetPhiOrStmtUse(uint64_t opId)
|
||||
+{
|
||||
+ vector<mlir::Value> ret;
|
||||
+ gimple *stmt = reinterpret_cast<gimple*>(opId);
|
||||
+ use_operand_p use_p;
|
||||
+ ssa_op_iter oi;
|
||||
+ FOR_EACH_PHI_OR_STMT_USE (use_p, stmt, oi, SSA_OP_USE) {
|
||||
+ tree op = USE_FROM_PTR (use_p);
|
||||
+ mlir::Value v = TreeToValue(reinterpret_cast<uint64_t>(reinterpret_cast<void*>(op)));
|
||||
+ ret.push_back(v);
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+vector<mlir::Value> GimpleToPluginOps::GetPhiOrStmtDef(uint64_t opId)
|
||||
+{
|
||||
+ vector<mlir::Value> ret;
|
||||
+ gimple *stmt = reinterpret_cast<gimple*>(opId);
|
||||
+ def_operand_p def_p;
|
||||
+ ssa_op_iter oi;
|
||||
+ FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, oi, SSA_OP_DEF) {
|
||||
+ tree op = DEF_FROM_PTR (def_p);
|
||||
+ mlir::Value v = TreeToValue(reinterpret_cast<uint64_t>(reinterpret_cast<void*>(op)));
|
||||
+ ret.push_back(v);
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+string parser_generic_tree_node(tree node)
|
||||
+{
|
||||
+ FILE *fp = tmpfile();
|
||||
+ if(fp==nullptr){
|
||||
+ return "";
|
||||
+ }
|
||||
+ pretty_printer buffer;
|
||||
+ pp_needs_newline(&buffer)=true;
|
||||
+ buffer.buffer->stream = fp;
|
||||
+ dump_generic_node(&buffer, node, 0, TDF_SLIM, false);
|
||||
+ std::string str(pp_formatted_text(&buffer));
|
||||
+ pp_newline_and_flush(&buffer);
|
||||
+ fclose(fp);
|
||||
+ return str;
|
||||
+}
|
||||
+
|
||||
+bool GimpleToPluginOps::RefsMayAlias(uint64_t id1, uint64_t id2, uint64_t flag)
|
||||
+{
|
||||
+ tree ref1 = reinterpret_cast<tree>(id1);
|
||||
+ tree ref2 = reinterpret_cast<tree>(id2);
|
||||
+ bool tbaa_p = false;
|
||||
+ if (flag) tbaa_p = true;
|
||||
+ return refs_may_alias_p (ref1, ref2, tbaa_p);
|
||||
+}
|
||||
+
|
||||
+bool GimpleToPluginOps::PTIncludesDecl(uint64_t ptrId, uint64_t declId)
|
||||
+{
|
||||
+ tree ptr = reinterpret_cast<tree>(ptrId);
|
||||
+ tree decl = reinterpret_cast<tree>(declId);
|
||||
+ struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
|
||||
+ if(!pi) return false;
|
||||
+ if(!decl){
|
||||
+ std::cout<<"this decl is invalid!";
|
||||
+ return false;
|
||||
+ }
|
||||
+ if(is_global_var(decl)){
|
||||
+ std::cout<<"decl is global var!"<<std::endl;
|
||||
+ }
|
||||
+ return pt_solution_includes(&pi->pt, decl);
|
||||
+}
|
||||
+
|
||||
+bool GimpleToPluginOps::PTsIntersect(uint64_t ptrId_1, uint64_t ptrId_2)
|
||||
+{
|
||||
+ tree ptr_1 = reinterpret_cast<tree>(ptrId_1);
|
||||
+ tree ptr_2 = reinterpret_cast<tree>(ptrId_2);
|
||||
+ struct ptr_info_def *pi_1 = SSA_NAME_PTR_INFO (ptr_1);
|
||||
+ struct ptr_info_def *pi_2 = SSA_NAME_PTR_INFO (ptr_2);
|
||||
+ if(!pi_1 || !pi_2) return false;
|
||||
+ return pt_solutions_intersect(&pi_1->pt, &pi_2->pt);
|
||||
+}
|
||||
+
|
||||
} // namespace PluginIR
|
||||
\ No newline at end of file
|
||||
diff --git a/lib/gccPlugin/gccPlugin.cpp b/lib/gccPlugin/gccPlugin.cpp
|
||||
index 1877651..3e10023 100755
|
||||
--- a/lib/gccPlugin/gccPlugin.cpp
|
||||
+++ b/lib/gccPlugin/gccPlugin.cpp
|
||||
@@ -193,6 +193,7 @@ static std::map<RefPassName, string> g_refPassName {
|
||||
{PASS_PHIOPT, "phiopt"},
|
||||
{PASS_SSA, "ssa"},
|
||||
{PASS_LOOP, "loop"},
|
||||
+ {PASS_LAD, "laddress"},
|
||||
{PASS_MAC, "materialize-all-clones"},
|
||||
};
|
||||
|
||||
@@ -232,6 +233,10 @@ void RegisterPassManagerSetup(unsigned int index, const ManagerSetupData& setupD
|
||||
passData.type = GIMPLE_PASS;
|
||||
passInfo.pass = new GimplePass(passData, index);
|
||||
break;
|
||||
+ case PASS_LAD:
|
||||
+ passData.type = GIMPLE_PASS;
|
||||
+ passInfo.pass = new GimplePass(passData, index);
|
||||
+ break;
|
||||
case PASS_MAC:
|
||||
passData.type = SIMPLE_IPA_PASS;
|
||||
passInfo.pass = new SimpleIPAPass(passData, index);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
From 954c37acbb0a9a790d07b567ad99c952e150e6da Mon Sep 17 00:00:00 2001
|
||||
From: Mingchuan Wu <wumingchuan1992@foxmail.com>
|
||||
Date: Tue, 27 Feb 2024 16:05:13 +0800
|
||||
Subject: [PATCH 5/5] [PluginClient] Bugfix for semaphore exception and port
|
||||
number release.
|
||||
|
||||
---
|
||||
lib/PluginClient/PluginClient.cpp | 16 +++++++++++++---
|
||||
lib/Translate/GimpleToPluginOps.cpp | 7 ++++++-
|
||||
2 files changed, 19 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/PluginClient/PluginClient.cpp b/lib/PluginClient/PluginClient.cpp
|
||||
index fba0de4..6bc6401 100644
|
||||
--- a/lib/PluginClient/PluginClient.cpp
|
||||
+++ b/lib/PluginClient/PluginClient.cpp
|
||||
@@ -1749,7 +1749,12 @@ static bool WaitServer(const string& port)
|
||||
mode_t mask = umask(0);
|
||||
mode_t mode = 0666; // 权限是rwrwrw,跨进程时,其他用户也要可以访问
|
||||
string semFile = "wait_server_startup" + port;
|
||||
- sem_t *sem = sem_open(semFile.c_str(), O_CREAT, mode, 0);
|
||||
+ sem_t *sem = sem_open(semFile.c_str(), O_CREAT | O_EXCL, mode, 0);
|
||||
+ // Semaphore exception handling.
|
||||
+ if (sem == SEM_FAILED) {
|
||||
+ sem_unlink(semFile.c_str());
|
||||
+ sem = sem_open(semFile.c_str(), O_CREAT, mode, 0);
|
||||
+ }
|
||||
umask(mask);
|
||||
int i = 0;
|
||||
for (; i < cnt; i++) {
|
||||
@@ -1770,8 +1775,13 @@ static bool WaitServer(const string& port)
|
||||
int PluginClient::ServerStart(pid_t& pid)
|
||||
{
|
||||
if (!grpcPort.FindUnusedPort()) {
|
||||
- LOGE("cannot find port for grpc,port 40001-65535 all used!\n");
|
||||
- return -1;
|
||||
+ // Rectify the fault that the port number is not released
|
||||
+ // because the client is abnormal.
|
||||
+ LOGW("cannot find port for grpc, try again!\n");
|
||||
+ if (!grpcPort.FindUnusedPort()) {
|
||||
+ LOGE("cannot find port for grpc,port 40001-65534 all used!\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
diff --git a/lib/Translate/GimpleToPluginOps.cpp b/lib/Translate/GimpleToPluginOps.cpp
|
||||
index 342ef3d..76c5e31 100644
|
||||
--- a/lib/Translate/GimpleToPluginOps.cpp
|
||||
+++ b/lib/Translate/GimpleToPluginOps.cpp
|
||||
@@ -1523,7 +1523,12 @@ Value GimpleToPluginOps::TreeToValue(uint64_t treeId)
|
||||
unsigned HOST_WIDE_INT uinit = tree_to_uhwi(t);
|
||||
initAttr = builder.getI64IntegerAttr(uinit);
|
||||
} else {
|
||||
- abort();
|
||||
+ wide_int val = wi::to_wide(t);
|
||||
+ if (wi::neg_p(val, TYPE_SIGN(TREE_TYPE(t)))) {
|
||||
+ val = -val;
|
||||
+ }
|
||||
+ signed HOST_WIDE_INT init = val.to_shwi();
|
||||
+ initAttr = builder.getI64IntegerAttr(init);
|
||||
}
|
||||
GetTreeAttr(treeId, readOnly, rPluginType);
|
||||
opValue = builder.create<ConstOp>(
|
||||
--
|
||||
2.33.0
|
||||
|
||||
1216
0015-MLIR17-Adaptation-to-llvm17-mlir17.patch
Normal file
1216
0015-MLIR17-Adaptation-to-llvm17-mlir17.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,13 +1,13 @@
|
||||
Name: pin-gcc-client
|
||||
Version: 0.4.1
|
||||
Release: 7
|
||||
Release: 14
|
||||
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,32 +19,23 @@ 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
|
||||
Patch12: 0012-Pin-gcc-client-Adaptation-to-gcc12-only-solves-the-b.patch
|
||||
Patch13: 0013-pin-gcc-client-Add-DataFlow-APIs.patch
|
||||
Patch14: 0014-PluginClient-Bugfix-for-semaphore-exception-and-port.patch
|
||||
Patch15: 0015-MLIR17-Adaptation-to-llvm17-mlir17.patch
|
||||
|
||||
%description
|
||||
A Pin (Plug-IN framework) client is implemented based on GCC plugin and can execute the compiler optimization pass in GCC.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
mkdir -p _build
|
||||
cd _build
|
||||
%{cmake} .. -DCMAKE_INSTALL_PREFIX=%{_usr} -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_SKIP_RPATH=ON -DMLIR_DIR=/usr/lib64/cmake/mlir -DLLVM_DIR=/usr/lib64/cmake/llvm
|
||||
|
||||
|
||||
%build
|
||||
cd _build
|
||||
%make_build
|
||||
|
||||
%install
|
||||
@ -54,7 +45,7 @@ cd _build
|
||||
mkdir -p %{buildroot}/etc/ld.so.conf.d
|
||||
echo "{_libdir}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
|
||||
find %{_libdir} -type f -name "*.so" -exec strip "{}" ";"
|
||||
find %{buildroot} -type f -name "*.so" -exec strip "{}" ";"
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
@ -66,13 +57,55 @@ 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.17
|
||||
%attr(0755,root,root) %{_libdir}/libMLIRPlugin.so
|
||||
%attr(0755,root,root) %{_libdir}/libMLIRPlugin.so.12
|
||||
%attr(0755,root,root) %{_libdir}/libMLIRPlugin.so.17
|
||||
%attr(0644,root,root) %{_bindir}/pin-gcc-client.json
|
||||
%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
|
||||
%changelog
|
||||
* Wed Apr 10 2024 wumingchuan <wumingchuan1992@foxmail.com> - 0.4.1-14
|
||||
- Type:Update
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Adaptation to llvm17/mlir17.
|
||||
|
||||
* Wed Apr 10 2024 wumingchuan <wumingchuan1992@foxmail.com> - 0.4.1-13
|
||||
- Type:Update
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Sync patch from openEuler/pin-gcc-client
|
||||
|
||||
* Tue Aug 22 2023 liyunfei <liyunfei33@huawei.com> - 0.4.1-12
|
||||
- Type:FIX
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:FIX clang toolchain error
|
||||
|
||||
* Thu Aug 3 2023 dingguangya <dingguangya1@huawei.com> - 0.4.1-11
|
||||
- Type:FIX
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:FIX STRIP problem
|
||||
|
||||
* Thu Aug 3 2023 dingguangya <dingguangya1@huawei.com> - 0.4.1-10
|
||||
- Type:FIX
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Adaptation to gcc12 only solves the build problem
|
||||
|
||||
* 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
|
||||
- SUG:NA
|
||||
- DESC:modify %patchxxx -p1 to %autosetup -p1
|
||||
|
||||
* Thu Apr 6 2023 dingguangya <dingguangya1@huawei.com> - 0.4.1-7
|
||||
- Type:Update
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user