From bfde54e388a9dcea90be3aebda176658d5b336b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Thu, 14 Mar 2002 12:53:24 +0000 Subject: [PATCH] Otptimization of SymConst to Const. [r331] --- ir/ir/irgopt.h | 6 ++++-- ir/ir/iropt.c | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ir/ir/irgopt.h b/ir/ir/irgopt.h index 8b1504880..b0215a683 100644 --- a/ir/ir/irgopt.h +++ b/ir/ir/irgopt.h @@ -35,6 +35,8 @@ void dead_node_elimination(ir_graph *irg); void remove_bad_predecessors(ir_graph *irg); /* Inlines a method at the given call site. + Removes the call node and splits the basic block the call node + belongs to. Inserts a copy of the called graph between these nodes. Assumes that call is a Call node in current_ir_graph and that the type in the Call nodes type attribute is the same as the type of the called graph. @@ -49,8 +51,8 @@ void remove_bad_predecessors(ir_graph *irg); if they are equal. Sets visited masterflag in current_ir_graph to the max of the flag in current and called graph. - Removes the call node and splits the basic block the call node - belongs to. Inserts a copy of the called graph between these nodes. + Assumes that both, the called and the calling graph are in state + "pinned". It is recommended to call local_optimize_graph after inlining as this function leaves a set of obscure Tuple nodes, e.g. a Proj-Tuple-Jmp combination as control flow operation. */ diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 83ffd7373..88555f9f8 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -72,6 +72,12 @@ computed_value (ir_node *n) switch (get_irn_opcode(n)) { case iro_Const: res = get_Const_tarval(n); + break; + case iro_SymConst: + if ((get_SymConst_kind(n) == size) && + (get_type_state(get_SymConst_type(n))) == layout_fixed) + res = tarval_from_long (mode_i, get_type_size(get_SymConst_type(n))); + break; case iro_Add: if (ta && tb && (get_irn_mode(a) == get_irn_mode(b)) && (get_irn_mode(a) != mode_p)) { -- 2.20.1