gcc/0190-sync-LLC-difference-between-source-and-patch-code.patch

70 lines
2.6 KiB
Diff

From 0f667a2f934023d2dd1636572f2dc8391334d7f8 Mon Sep 17 00:00:00 2001
From: liuf9 <liufeiyang6@huawei.com>
Date: Wed, 29 May 2024 20:14:02 +0800
Subject: [PATCH] b
---
gcc/tree-ssa-llc-allocate.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/gcc/tree-ssa-llc-allocate.c b/gcc/tree-ssa-llc-allocate.c
index 297790a..62b5f18 100644
--- a/gcc/tree-ssa-llc-allocate.c
+++ b/gcc/tree-ssa-llc-allocate.c
@@ -1527,7 +1527,7 @@ trace_ref_dimension_and_loop_bounds (data_ref &mem_ref)
tree
get_cur_loop_niters (map<class loop*, vector<data_ref> > &loop_refs,
- class loop* loop)
+ class loop* loop)
{
if (loop_refs.count (loop) == 0)
return NULL_TREE;
@@ -1565,7 +1565,6 @@ trace_outer_loop_depth (tree niters, unsigned start_depth)
{
/* Trace the SSA that define this niter. */
def_stmt = SSA_NAME_DEF_STMT (niters);
- enum gimple_code stmt_code = gimple_code (def_stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "ssa_name of niters: ");
@@ -1575,7 +1574,8 @@ trace_outer_loop_depth (tree niters, unsigned start_depth)
fprintf (dump_file, "\n");
}
/* Termination condition of dfs. Return the depth of the bb block. */
- if (stmt_code == GIMPLE_PHI || stmt_code == GIMPLE_NOP)
+ if (gimple_code (def_stmt) == GIMPLE_PHI
+ || gimple_code (def_stmt) == GIMPLE_NOP)
{
basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (niters));
if (def_bb == NULL || def_bb->loop_father == NULL)
@@ -1584,13 +1584,13 @@ trace_outer_loop_depth (tree niters, unsigned start_depth)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Stop tracing the outer loop depth, ");
- fprintf (dump_file, "current depth: %d, current bb: %d\n", \
+ fprintf (dump_file, "current depth: %d, current bb: %d\n",
ret_depth, def_bb->index);
}
return ret_depth;
}
/* 'ASSIGN': Use dfs to trace the rhs of the assignment statement. */
- else if (stmt_code == GIMPLE_ASSIGN)
+ else if (gimple_code (def_stmt) == GIMPLE_ASSIGN)
{
tree rhs = gimple_assign_rhs1 (def_stmt);
if (TREE_CODE (rhs) == TARGET_MEM_REF)
@@ -1605,8 +1605,7 @@ trace_outer_loop_depth (tree niters, unsigned start_depth)
/* 'ASSIGN': start from 1 because op[0] is the lhs. */
for (unsigned i = 1; i < operand_num; i++)
{
- tree subtree = GIMPLE_CHECK2<const gassign *>
- (def_stmt)->op[i];
+ tree subtree = dyn_cast<gassign *>(def_stmt)->op[i];
if (subtree == NULL)
continue;
unsigned depth = trace_outer_loop_depth (subtree, \
--
2.33.0