!60 [sync] PR-58: [MLIR17] Adaptation to llvm17/mlir17.

From: @openeuler-sync-bot 
Reviewed-by: @wumingchuan 
Signed-off-by: @wumingchuan
This commit is contained in:
openeuler-ci-bot 2024-04-10 11:11:43 +00:00 committed by Gitee
commit 54ef742134
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 2984 additions and 3 deletions

View File

@ -0,0 +1,26 @@
From 53b9b9ea326df8fec717260eda09e5d73d7a30cd Mon Sep 17 00:00:00 2001
From: qiujiacai <qiujiacai_yewu@cmss.chinamobile.com>
Date: Wed, 20 Sep 2023 18:28:49 +0800
Subject: [PATCH 4/7] [Pin-Server] Added null pointer check to avoid potential
null pointer problems
---
user/ArrayWidenPass.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/user/ArrayWidenPass.cpp b/user/ArrayWidenPass.cpp
index 475f784..cafb177 100644
--- a/user/ArrayWidenPass.cpp
+++ b/user/ArrayWidenPass.cpp
@@ -702,6 +702,8 @@ static bool checkBodyMemRef(Value memRef)
static bool checkBodyPointerPlus(Operation *op, Value &tmpIndex)
{
auto assignOp = dyn_cast<AssignOp>(op);
+ if(!assignOp)
+ return false;
Value rhs1 = assignOp.GetRHS1();
Value rhs2 = assignOp.GetRHS2();
--
2.33.0

View File

@ -0,0 +1,61 @@
From b239a7940f1439d425cb37729fe380db73734856 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, 3 Nov 2023 11:39:12 +0800
Subject: [PATCH 5/7] [Pin-server] Bugfix for the operation sequence of
userOpts.
---
lib/PluginServer/PluginServer.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/PluginServer/PluginServer.cpp b/lib/PluginServer/PluginServer.cpp
index 8778019..9a8d5e5 100644
--- a/lib/PluginServer/PluginServer.cpp
+++ b/lib/PluginServer/PluginServer.cpp
@@ -23,6 +23,7 @@
#include <thread>
#include <fcntl.h>
#include <sys/stat.h>
+#include <mutex>
#include "PluginAPI/PluginServerAPI.h"
#include "user/user.h"
@@ -34,6 +35,8 @@ using namespace PluginOpt;
using std::cout;
using std::endl;
using std::pair;
+
+static std::mutex register_mutex; // 线程锁
PluginServer *PluginServer::pluginServerPtr = nullptr;
PluginServer *PluginServer::GetInstance()
{
@@ -273,6 +276,7 @@ void PluginServer::ParseArgv(const string& data)
void PluginServer::SendRegisteredUserOpts()
{
+ register_mutex.lock();
for (auto it = userOpts.begin(); it != userOpts.end(); it++) {
string key = "injectPoint";
for (auto& userOpt : it->second) {
@@ -286,6 +290,7 @@ void PluginServer::SendRegisteredUserOpts()
}
}
pluginCom.ServerSend("injectPoint", "finished");
+ register_mutex.unlock();
}
void PluginServer::ServerSemPost(const string& port)
@@ -307,8 +312,9 @@ void PluginServer::RunServer()
}
log->LOGI("Server ppid:%d listening on port:%s\n", getppid(), port.c_str());
ServerSemPost(port);
-
+ register_mutex.lock();
RegisterCallbacks();
+ register_mutex.unlock();
log->LOGI("RunServer: RegisterCallbacks Done.\n");
pluginCom.Run();
}
--
2.33.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
Name: pin-server
Version: 0.4.0
Release: 14
Release: 16
Summary: Pin (Plug-IN framework) server provides plugin APIs for compiler optimization developers to develop optimization pass.
License: Apache 2.0
URL: https://gitee.com/openeuler/pin-server
@ -40,6 +40,10 @@ Patch27: 0027-Pin-server-Optimized-LocalVarSummeryPass.patch
Patch28: 0028-Pin-server-Adaptation-to-llvm15-mlir15-only-solves-t.patch
Patch29: 0029-Pin-server-Adaptation-to-gcc12-only-solves-the-build.patch
Patch30: 0030-Pin-server-fix-the-adaptation-to-grpc-1.54.2.patch
Patch31: 0031-Pin-Server-Added-null-pointer-check-to-avoid-potenti.patch
Patch32: 0032-Pin-server-Bugfix-for-the-operation-sequence-of-user.patch
Patch33: 0033-Pin-server-Add-DataFlow-APIs.patch
Patch34: 0034-MLIR17-Adaptation-to-llvm17-mlir17.patch
%description
Pin (Plug-IN framework) server provides plugin APIs for compiler optimization developers to develop optimization pass.
@ -87,13 +91,25 @@ find %{_libdir} -type f -name "libMLIRServerAPI.so" -exec strip "{}" ";"
%files demo
%attr(0755,root,root) %{_libdir}/libpin_user.so
%attr(0755,root,root) %{_libdir}/libMLIRPluginServer.so
%attr(0755,root,root) %{_libdir}/libMLIRPluginServer.so.15
%attr(0755,root,root) %{_libdir}/libMLIRPluginServer.so.17
%attr(0755,root,root) %{_libdir}/libMLIRServerAPI.so
%attr(0755,root,root) %{_libdir}/libMLIRServerAPI.so.15
%attr(0755,root,root) %{_libdir}/libMLIRServerAPI.so.17
%attr(0644,root,root) %{_libdir}/libpin_user.sha256
%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf
%changelog
* Tue Apr 09 2024 wumingchuan <wumingchuan1992@foxmail.com> - 0.4.0-16
- Type:FIX
- ID:NA
- SUG:NA
- DESC:Adaptation to llvm17/mlir17
* Mon Apr 08 2024 wumingchuan <wumingchuan1992@foxmail.com> - 0.4.0-15
- Type:FIX
- ID:NA
- SUG:NA
- DESC:Sync patch from openEuler/pin-server
* Tue Aug 22 2023 liyunfei <liyunfei33@huawei.com> - 0.4.0-14
- Type:FIX
- ID:NA