加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0005-Pin-server-Add-API-for-LTO-judgement.patch 2.18 KB
一键复制 编辑 原始数据 按行查看 历史
From 47f1208aab2acb3e1a8442d830125ad3b54149c5 Mon Sep 17 00:00:00 2001
From: benniaobufeijiushiji <linda7@huawei.com>
Date: Sun, 19 Feb 2023 14:40:09 +0800
Subject: [PATCH 05/23] [Pin-server] Add API for LTO judgement
diff --git a/include/PluginAPI/BasicPluginOpsAPI.h b/include/PluginAPI/BasicPluginOpsAPI.h
index 0ca0ac4..f83b888 100644
--- a/include/PluginAPI/BasicPluginOpsAPI.h
+++ b/include/PluginAPI/BasicPluginOpsAPI.h
@@ -70,6 +70,8 @@ public:
virtual uint32_t AddArgInPhiOp(uint64_t, uint64_t, uint64_t, uint64_t) = 0;
virtual PhiOp CreatePhiOp(uint64_t, uint64_t) = 0;
virtual void DebugValue(uint64_t) = 0;
+ virtual bool IsLtoOptimize() = 0;
+ virtual bool IsWholeProgram() = 0;
virtual mlir::Value GetCurrentDefFromSSA(uint64_t) = 0;
virtual bool SetCurrentDefInSSA(uint64_t, uint64_t) = 0;
diff --git a/include/PluginAPI/PluginServerAPI.h b/include/PluginAPI/PluginServerAPI.h
index 0655d80..b2f8fbf 100644
--- a/include/PluginAPI/PluginServerAPI.h
+++ b/include/PluginAPI/PluginServerAPI.h
@@ -74,6 +74,8 @@ public:
/* Plugin API for ConstOp. */
mlir::Value CreateConstOp(mlir::Attribute, mlir::Type) override;
void DebugValue(uint64_t) override;
+ bool IsLtoOptimize() override;
+ bool IsWholeProgram() override;
mlir::Value GetCurrentDefFromSSA(uint64_t) override;
bool SetCurrentDefInSSA(uint64_t, uint64_t) override;
diff --git a/lib/PluginAPI/PluginServerAPI.cpp b/lib/PluginAPI/PluginServerAPI.cpp
index 523e08d..f81a3ad 100644
--- a/lib/PluginAPI/PluginServerAPI.cpp
+++ b/lib/PluginAPI/PluginServerAPI.cpp
@@ -587,4 +587,20 @@ void PluginServerAPI::DebugValue(uint64_t valId)
PluginServer::GetInstance()->RemoteCallClientWithAPI(funName, params);
}
+bool PluginServerAPI::IsLtoOptimize()
+{
+ Json::Value root;
+ string funName = __func__;
+ string params = root.toStyledString();
+ return PluginServer::GetInstance()->GetBoolResult(funName, params);
+}
+
+bool PluginServerAPI::IsWholeProgram()
+{
+ Json::Value root;
+ string funName = __func__;
+ string params = root.toStyledString();
+ return PluginServer::GetInstance()->GetBoolResult(funName, params);
+}
+
} // namespace Plugin_IR
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化