代码拉取完成,页面将自动刷新
From bfb77997f423ffe3bdcbd8bb8d7f739fe51ce4f5 Mon Sep 17 00:00:00 2001
From: Diachkov Ilia <diachkov.ilia1@huawei-partners.com>
Date: Fri, 6 Sep 2024 11:36:11 +0800
Subject: [PATCH 3/3] Fix error with stmts insertion in ipa-prefetch (for
IAO6R3)
Signed-off-by: Diachkov Ilia <diachkov.ilia1@huawei-partners.com>
---
gcc/ipa-prefetch.cc | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/gcc/ipa-prefetch.cc b/gcc/ipa-prefetch.cc
index b000d4d75..6190c2ebb 100644
--- a/gcc/ipa-prefetch.cc
+++ b/gcc/ipa-prefetch.cc
@@ -2096,7 +2096,7 @@ optimize_function (cgraph_node *n, function *fn)
fprintf (dump_file, "\n");
}
- /* Try to find comp_mr's stmt in the dominator bb. */
+ /* Try to find comp_mr's stmt in the post dominator bb. */
gimple *last_used = NULL;
for (gimple_stmt_iterator si = gsi_last_bb (dom_bb); !gsi_end_p (si);
gsi_prev (&si))
@@ -2168,7 +2168,22 @@ optimize_function (cgraph_node *n, function *fn)
vec<gimple *> pcalls = vNULL;
gimple *last_pref = NULL;
insert_prefetch_stmts (pcalls, stmts, last_pref, vmrs, processed_stmts);
- gsi_insert_seq_after (&gsi, stmts, GSI_NEW_STMT);
+
+ gimple *gstmt = gsi_stmt (gsi);
+ bool insert_after = last_used || gstmt == NULL || !is_ctrl_stmt (gstmt);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Insert prefetch sequence %s stmt:\n",
+ insert_after ? "after": "before");
+ if (gstmt)
+ print_gimple_stmt (dump_file, gstmt, 0);
+ else
+ fprintf (dump_file, "(no stmts)\n");
+ }
+ if (insert_after)
+ gsi_insert_seq_after (&gsi, stmts, GSI_NEW_STMT);
+ else
+ gsi_insert_seq_before (&gsi, stmts, GSI_NEW_STMT);
correct_cfg (bbends, last_pref, dom_bb);
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。