1 Star 0 Fork 0

huangxiaoquan/gcc-test

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001.iap.patch 2.30 KB
一键复制 编辑 原始数据 按行查看 历史
huangxiaoquan 提交于 2024-11-21 04:08 . add modify
From 0dcb4f52399f0ba06ee72c54622aaf1c95da18e5 Mon Sep 17 00:00:00 2001
From: h00564365 <[email protected]>
Date: Thu, 21 Nov 2024 11:57:48 +0800
Subject: [PATCH] ipa-modify
---
gcc/ipa-inline.cc | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc
index 4e93652bb..8d5cc9a84 100644
--- a/gcc/ipa-inline.cc
+++ b/gcc/ipa-inline.cc
@@ -229,7 +229,7 @@ caller_growth_limits (struct cgraph_edge *e)
the function is located. */
static void
-prompt_inline_failed_reason (struct cgraph_edge *e)
+prompt_inline_failed_target_option_reason (struct cgraph_edge *e)
{
static std::set<std::pair<void*, void*>> address_pair_set;
if (e->inline_failed == CIF_TARGET_OPTION_MISMATCH
@@ -289,7 +289,8 @@ report_inline_failed_reason (struct cgraph_edge *e)
(dump_file, 2, opts_for_fn (e->caller->decl),
opts_for_fn (e->callee->ultimate_alias_target ()->decl));
}
- prompt_inline_failed_reason (e);
+
+ prompt_inline_failed_target_option_reason (e);
}
/* Decide whether sanitizer-related attributes allow inlining. */
@@ -351,18 +352,23 @@ sanitize_attrs_match_for_inline_p (const_tree caller, const_tree callee)
static cgraph_node *
find_related_node_lto_file_data (cgraph_node *node)
{
- struct ipa_ref *ref = NULL;
-
- /* Switch to the original function, for example xxx.constprop.x function. */
- if (node->clone_of)
- node = node->clone_of;
+ cgraph_node *cur = node;
- /* Find the lto_file_data information of referring. */
- for (int i = 0; node->iterate_referring (i, ref); i++)
+ while (cur->clone_of)
{
- struct cgraph_node *cnode = dyn_cast <cgraph_node *> (ref->referring);
- if (cnode && cnode->lto_file_data)
- return cnode;
+ /* Switch to original node, for example xxx.constprop.x function. */
+ cur = cur->clone_of;
+ if (cur->lto_file_data)
+ return cur;
+
+ /* Find the lto_file_data information of referring. */
+ struct ipa_ref *ref = NULL;
+ for (int i = 0; cur->iterate_referring (i, ref); i++)
+ {
+ struct cgraph_node *cnode = dyn_cast <cgraph_node *> (ref->referring);
+ if (cnode && cnode->lto_file_data)
+ return cnode;
+ }
}
return NULL;
--
2.28.0.windows.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huang-xiaoquan/gcc-test.git
[email protected]:huang-xiaoquan/gcc-test.git
huang-xiaoquan
gcc-test
gcc-test
master

搜索帮助