doxygen docu fixed
[libfirm] / ir / opt / strength_red.c
1 /**
2  *
3  * @file strength_red.c
4  *
5  * Project:     libFIRM
6  * File name:   ir/opt/strength_red.c
7  * Purpose:     Make strength reduction .
8  * Author:      Beyhan Veliev
9  * Modified by:
10  * Created:     22.8.2004
11  * CVS-ID:      $Id$
12  * Copyright:   (c) 2004 Universität Karlsruhe
13  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
14  */
15
16
17 /*
18
19 reducible(o)
20    while (reducible)
21      o = reduce(o)
22
23 reduce_itervar(induct_var_info *iv)
24   for each (out o of iv) {
25     if (o is reducible) {
26        if (o is strong (Mul))
27          iv_new = reduce(o), remember_pattern(o)
28        else     // o is not strong (Add ...)
29          if (o is the only user)
30            iv_new = reducible(o)
31     }
32   }
33
34 */
35
36 # include "strength_red.h"
37
38 # include "irouts.h"
39 # include "irnode_t.h"
40 # include "irgwalk.h"
41 # include "irloop_t.h"
42 # include "ircons.h"
43 # include "irgmod.h"
44 # include "irdump_t.h"
45 # include "firmstat.h"
46
47
48 /** Counter for verbose information about optimization. */
49 static int n_reduced_expressions;
50 static int n_made_new_phis;
51
52 /** Detect basic iteration variables.
53  *
54  * The variable ir represented by a subgraph as this:
55  * @verbatim
56  *
57  *       init
58  *       /|\
59  *        |
60  *   |-- Phi
61  *   |   /|\
62  *   |    |
63  *   |-->op
64  *
65  * @endverbatim
66  * Where op is a Add or Sub, and init is loop invariant.
67  *
68  * @todo
69  * So far we only accept Phi nodes with two predecessors.
70  * We could expand this to Phi nodes where all preds are either
71  * op or loop invariant.
72  *
73  * @param info  After call contains the induction variable information.
74  */
75 induct_var_info *is_induction_variable (induct_var_info *info) {
76
77   int i;
78   int op_pred, Store_in_op, Store_in_phi;
79   ir_node *cmp_pred_bl, *cond_succ_true, *cond_succ_false, *cmp_const;
80   ir_node *loop_head;
81   ir_node *cmp_const_block;
82
83   info->c                = NULL;
84   info->cmp              = NULL;
85   info->cmp_const        = NULL;
86   info->cmp_init_block   = NULL;
87   info->increment        = NULL;
88   info->init             = NULL;
89   info->l_itervar_phi    = NULL;
90   info->new_add          = NULL;
91   info->new_cmp          = NULL;
92   info->new_increment    = NULL;
93   info->new_init         = NULL;
94   info->new_op           = NULL;
95   info->new_phi          = NULL;
96   info->operation_code   = NULL;
97   info->op               = NULL;
98   info->old_ind          = NULL;
99   info->reducible_node   = NULL;
100   info->out_loop_res     = 1;
101   info->reducible        = 0;
102   info->phi_pred         = 0;
103   info->strong_reduced   = 0;
104   info->init_pred_pos    = -1;
105   info->op_pred_pos      = -1;
106
107   assert(get_irn_op(info->itervar_phi) == op_Phi);
108
109   /* The necessary conditions for the phi node. */
110   if (get_irn_arity(info->itervar_phi) != 2             ||
111       !has_backedges(get_nodes_block(info->itervar_phi))  )
112     return NULL;
113
114   for (i = 0; i < 2; ++i) {
115     ir_node *pred = get_Phi_pred(info->itervar_phi, i);
116     ir_op *op = get_irn_op(pred);
117
118     /* Compute if the induction variable is added or substracted with a constant . */
119     if (op == op_Add || op == op_Sub) {
120       ir_node *n_l = get_binop_left(pred);
121       ir_node *n_r = get_binop_right(pred);
122
123       if (n_l == info->itervar_phi) {
124         info->operation_code = op;
125         info->increment      = n_r;
126         info->op_pred_pos    = i;
127         info->init_pred_pos  = i ^ 1;
128         break;
129       }
130       else if (n_r == info->itervar_phi) {
131         info->operation_code = op;
132         info->increment      = n_l;
133         info->op_pred_pos    = i;
134         info->init_pred_pos  = i ^ 1;
135         break;
136       }
137     }
138   }
139   /* check if we found something */
140   if (! info->operation_code)
141     return NULL;
142
143   /* Compute the position of the backedge. */
144   if (is_backedge(get_nodes_block(info->itervar_phi), info->op_pred_pos)){
145     info->op     = get_Phi_pred(info->itervar_phi, info->op_pred_pos);
146     info->init   = get_Phi_pred(info->itervar_phi, info->init_pred_pos);
147   }
148   else {
149     /* irregular control flow detected. */
150     return NULL;
151   }
152
153   if (get_Block_dom_depth(get_nodes_block(info->init))  >=
154       get_Block_dom_depth(get_nodes_block(info->itervar_phi))) {
155     return NULL;
156   }
157
158   /* This "for" marks if the iteration operation have a Store successor .*/
159   op_pred      = get_irn_n_outs(info->op);
160   Store_in_op  = 0;
161   Store_in_phi = 0;
162
163   /* Information about loop of itervar_phi. */
164   info->l_itervar_phi = get_irn_loop(get_nodes_block(info->itervar_phi));
165
166   /* This "for" searches for the Cmp successor of the
167      iter_var to reduce and marks if the iter_var have a Store
168      successor or a successor out of loop.*/
169   info->phi_pred = get_irn_n_outs(info->itervar_phi);
170   loop_head = get_nodes_block(info->itervar_phi);
171
172   for (i = 0; i < info->phi_pred; i++) {
173     ir_node *out = get_irn_out(info->itervar_phi, i);
174     ir_op   *out_op = get_irn_op(out);
175     if ((get_irn_loop(get_nodes_block(out)) != info->l_itervar_phi) &&
176         ( get_Block_dom_depth(get_nodes_block(out))  >
177           get_Block_dom_depth(get_nodes_block(info->itervar_phi))))
178       info->out_loop_res = 0;
179
180     if (out_op == op_Store)
181       Store_in_phi++;
182     else {
183       if (out_op == op_Cmp && !is_loop_invariant(out, loop_head)){
184               cmp_pred_bl = get_irn_out(out, 0);
185               cmp_pred_bl = get_irn_out(cmp_pred_bl, 0);
186               cond_succ_true = get_irn_out(cmp_pred_bl, 1);
187               cond_succ_false = get_irn_out(cmp_pred_bl, 0);
188               if(is_loop_invariant(get_irn_out(cond_succ_false, 0), loop_head) ||
189                  is_loop_invariant(get_irn_out(cond_succ_true, 0), loop_head)){
190                 if (get_Cmp_left(out) == info->itervar_phi)
191                   cmp_const = get_Cmp_right(out);
192                 else
193                   cmp_const = get_Cmp_left(out);
194         } else
195                 continue;
196               if (info->cmp == NULL) {
197                 info->cmp = out;
198                 info->cmp_const = cmp_const;
199         } else {
200                 info->cmp = NULL;
201                 return NULL;
202               }
203       }
204     }
205   }
206
207   for (i = 0; i < op_pred; ++i){
208     ir_node *out    = get_irn_out(info->op, i);
209     ir_op   *out_op = get_irn_op(out);
210
211     if (out_op == op_Store)
212       Store_in_op++;
213     else {
214       if (out_op == op_Cmp && !is_loop_invariant(out, loop_head)){
215               cmp_pred_bl = get_irn_out(out, 0);
216               cmp_pred_bl = get_irn_out(cmp_pred_bl, 0);
217               cond_succ_true = get_irn_out(cmp_pred_bl, 1);
218               cond_succ_false = get_irn_out(cmp_pred_bl, 0);
219               if(is_loop_invariant(get_irn_out(cond_succ_false, 0), loop_head) ||
220                  is_loop_invariant(get_irn_out(cond_succ_true, 0), loop_head)){
221                 if (get_Cmp_left(out) == info->op)
222                   cmp_const = get_Cmp_right(out);
223                 else
224                   cmp_const = get_Cmp_left(out);
225         } else
226                 continue;
227               if (info->cmp == NULL) {
228                 info->cmp = out;
229                 info->cmp_const = cmp_const;
230                 set_irn_link(info->cmp_const, (void *) 1);
231         } else {
232                 info->cmp = NULL;
233                 return NULL;
234               }
235       }
236     }
237   }
238
239
240   if((info->phi_pred == 3 && op_pred == 1 && Store_in_phi == 0 && info->cmp != NULL)  ||
241      (info->phi_pred == 2 && op_pred == 2 && Store_in_op == 0 && info->cmp != NULL )  ||
242      (info->phi_pred == 1 && Store_in_op == 0))
243     info->reducible = 1;
244
245   // Search for loop invariant of Cmp.
246     if(info->cmp != NULL){
247       cmp_const_block = get_nodes_block(info->cmp_const);
248       if (get_Block_dom_depth(get_nodes_block(info->init)) >=
249                 get_Block_dom_depth(cmp_const_block))
250               info->cmp_init_block = get_nodes_block(info->init);
251             else
252               info->cmp_init_block = cmp_const_block;
253     }
254     return info;
255 }
256
257 /**
258  * Creates a new Add node from operands.
259  */
260 static INLINE ir_node *
261 my_new_r_Add (ir_graph *irg, ir_node *b, ir_node *op1, ir_node *op2) {
262   ir_mode *m  = get_irn_mode(op1);
263   ir_mode *m2 = get_irn_mode(op2);
264
265   if (mode_is_reference(m2))
266     m = m2;
267   return new_r_Add(irg, b, op1, op2, m);
268 }
269
270 /**
271  * Creates a new Sub node from operands.
272  */
273 static INLINE ir_node *
274 my_new_r_Sub (ir_graph *irg, ir_node *b, ir_node *op1, ir_node *op2) {
275   ir_mode *m  = get_irn_mode(op1);
276   ir_mode *m2 = get_irn_mode(op2);
277
278   if (mode_is_reference(m) && mode_is_reference(m2))
279     m = mode_Is;        /* FIXME: may be other mode! */
280   else if (mode_is_reference(m2))
281     m = m2;
282   return new_r_Sub(irg, b, op1, op2, m);
283 }
284
285 /* Reduce a Add, Sub or Mul node
286  *
287  * @param *reduce_var  The node to reduce.
288  * @param *ivi         Contains the induction variable information.
289  */
290 static int reduce(ir_node *reduce_var, induct_var_info *ivi)
291 {
292   /* Essential conditions for a reducible node. */
293   if (get_irn_loop(get_nodes_block(reduce_var)) != ivi->l_itervar_phi)
294     return 0;
295
296   if (get_irn_op(reduce_var) == op_Mul) {
297     ir_node *mul_init  = NULL;
298     ir_node *mul_const = NULL;
299
300     /* Search for constant and init of strong. */
301     ir_node  *mul_right = get_Mul_right(reduce_var);
302     ir_node  *mul_left  = get_Mul_left(reduce_var);
303     ir_op *mul_right_op = get_irn_op(mul_right);
304     ir_op  *mul_left_op = get_irn_op(mul_left);
305
306     ir_node *in[2], *block_init;
307     ir_node *block_inc;
308
309     ir_node *init_block;
310     ir_node *increment_block;
311     ir_node *c_block;
312
313     n_reduced_expressions++;
314
315     if (mul_right_op == op_Const) {
316       mul_const = mul_right;
317       mul_init  = mul_left;
318     }
319     else if (mul_left_op == op_Const) {
320       mul_const = mul_left;
321       mul_init  = mul_right;
322     }
323
324     if (mul_const == NULL || mul_init == NULL)
325       return 0;
326
327     init_block      = get_nodes_block(mul_init);
328     increment_block = get_nodes_block(ivi->increment);
329     c_block         = get_nodes_block(mul_const);
330
331     if (get_Block_dom_depth(increment_block) >= get_Block_dom_depth(c_block))
332       block_inc = increment_block;
333     else
334       block_inc = c_block;
335
336     if (get_Block_dom_depth(init_block) >= get_Block_dom_depth(c_block))
337       block_init = init_block;
338     else
339       block_init = c_block;
340
341     if (! ivi->reducible){
342       int reduce_var_pred;
343
344       /* Essential condition for the constant of strong. */
345       if (get_Block_dom_depth(get_nodes_block(mul_const))  >=
346           get_Block_dom_depth(get_nodes_block(ivi->itervar_phi)))
347         return 0;
348
349       n_made_new_phis++;
350       if (get_opt_strength_red_verbose() && get_firm_verbosity() > 1) {
351         printf("The new Phi node is : "); DDMN(ivi->itervar_phi);
352         printf("reducing operation is : "); DDMN(reduce_var);
353         printf("in graph : "); DDMG(current_ir_graph);
354       }
355
356       ivi->new_increment  = new_r_Mul (current_ir_graph, block_inc, ivi->increment, mul_const,
357                                        get_irn_mode(mul_const));
358       if (!(get_irn_op(mul_init) == op_Phi)){
359         ivi->new_init = new_r_Mul (current_ir_graph, block_init, ivi->init, mul_const,
360                                    get_irn_mode(mul_const));
361         ivi->new_init = my_new_r_Add(current_ir_graph, block_init, ivi->new_init,
362                                     ivi->new_increment);
363       } else
364         ivi->new_init = new_r_Mul (current_ir_graph, block_init, ivi->init, mul_const,
365                                    get_irn_mode(mul_const));
366
367       /* Generate a new basic induction variable. Break the data flow loop
368          initially by using an Unknown node. */
369
370       in[ivi->op_pred_pos]   = new_Unknown(get_irn_mode(ivi->new_init));
371
372       in[ivi->init_pred_pos] = ivi->new_init;
373       ivi->new_phi = new_r_Phi(current_ir_graph, get_nodes_block(ivi->itervar_phi), 2, in,
374                                get_irn_mode(mul_const));
375       mark_irn_visited(ivi->new_phi);
376
377       if (ivi->operation_code == op_Add)
378         ivi->new_op = my_new_r_Add(current_ir_graph, get_nodes_block(ivi->op),
379                                   ivi->new_increment,ivi-> new_phi);
380       else if (ivi->operation_code == op_Sub)
381         ivi->new_op = my_new_r_Sub(current_ir_graph, get_nodes_block(ivi->op),ivi-> new_phi,
382                                    ivi->new_increment);
383
384       set_Phi_pred(ivi->new_phi, ivi->op_pred_pos, ivi->new_op);
385
386
387
388
389
390       // This for search for a reducible successor of reduc_var.
391       reduce_var_pred =  get_irn_n_outs(reduce_var);
392       if (reduce_var_pred == 1) {
393         ir_node *old_ind =get_irn_out(reduce_var, 0);
394         if(get_irn_op(old_ind) == op_Add || get_irn_op(old_ind) == op_Sub ||
395            get_irn_op(old_ind) == op_Mul){
396           ivi->reducible = 1;
397           ivi->reducible_node = old_ind;
398         }
399       }
400       /* Replace the use of the strength reduced value. */
401       exchange(reduce_var, ivi->new_phi);
402       return 1;
403     }
404     else { /* ivi->reducible */
405       if(ivi->new_phi == NULL){
406         ivi->init = new_r_Mul (current_ir_graph, get_nodes_block(ivi->init),
407                                mul_const, ivi->init,
408                                get_irn_mode(mul_const));
409         if(ivi->cmp != NULL)
410           ivi->cmp_const = new_r_Mul (current_ir_graph, ivi->cmp_init_block,
411                                       ivi->cmp_const, mul_const, get_irn_mode(mul_const));
412         ivi->increment = new_r_Mul (current_ir_graph, block_init,
413                                     ivi->increment, mul_const, get_irn_mode(mul_const));
414       } else {
415         ivi->new_init = new_r_Mul (current_ir_graph, get_nodes_block(ivi->init),
416                                    mul_const, ivi->new_init,
417                                    get_irn_mode(mul_const));
418         ivi->new_increment = new_r_Mul (current_ir_graph, block_init,
419                                         ivi->new_increment, mul_const,
420                                         get_irn_mode(mul_const));
421       }
422       if (get_opt_strength_red_verbose() && get_firm_verbosity() > 1) {
423         printf("\nReducing operation is : "); DDMN(reduce_var);
424         printf("in graph : "); DDMG(current_ir_graph);
425       }
426       return 1;
427     }
428
429   } else if (get_irn_op (reduce_var) == op_Add) {
430     ir_node *add_init  = NULL;
431     ir_node *add_const = NULL;
432
433     // Search for constant of add.
434     ir_node  *add_right = get_Add_right(reduce_var);
435     ir_node  *add_left  = get_Add_left(reduce_var);
436     ir_op *add_right_op = get_irn_op(add_right);
437     ir_op  *add_left_op = get_irn_op(add_left);
438
439     n_reduced_expressions++;
440
441     if (add_right_op != op_Const)
442       add_init = add_right;
443     else if (add_left_op != op_Const)
444       add_init = add_left;
445     if (add_right_op == op_Const || add_right_op == op_SymConst)
446       add_const = add_right;
447     else if (add_left_op == op_Const || add_left_op == op_SymConst)
448       add_const = add_left;
449     if (add_const == NULL) return 0;
450     if (ivi->new_phi == NULL){
451       ivi->init = my_new_r_Add (current_ir_graph, get_nodes_block(ivi->init),
452                                 add_const, ivi->init);
453       if(ivi->cmp != NULL)
454         ivi->cmp_const = my_new_r_Add (current_ir_graph, ivi->cmp_init_block,
455                                        add_const, ivi->cmp_const);
456     } else{
457       ivi->new_init = my_new_r_Add (current_ir_graph, get_nodes_block(ivi->init),
458                                     add_const, ivi->new_init);
459     }
460     if (get_opt_strength_red_verbose() && get_firm_verbosity() > 1) {
461       printf("\nReducing operation is : "); DDMN(reduce_var);
462       printf("in graph : "); DDMG(current_ir_graph);
463     }
464     return 1;
465   } else if(get_irn_op(reduce_var) == op_Sub ){
466     ir_node *sub_init  = NULL;
467     ir_node *sub_const = NULL;
468     // Search for constant of sub.
469     ir_node  *sub_right = get_Sub_right(reduce_var);
470     ir_node  *sub_left  = get_Sub_left(reduce_var);
471     ir_op *sub_right_op = get_irn_op(sub_right);
472     ir_op  *sub_left_op = get_irn_op(sub_left);
473
474     n_reduced_expressions++;
475
476     if (sub_right_op != op_Const)
477       sub_init = sub_right;
478     else if (sub_left_op != op_Const)
479       sub_init = sub_left;
480     if (sub_right_op == op_Const)
481       sub_const = sub_right;
482     else if (sub_left_op == op_Const)
483       sub_const = sub_left;
484
485     if (sub_const == NULL) return 0;
486
487     if (ivi->new_phi == NULL) {
488       ivi->init = my_new_r_Sub (current_ir_graph, get_nodes_block(ivi->init),
489                                 ivi->init, sub_const);
490       if (ivi->cmp != NULL)
491         ivi->cmp_const =my_new_r_Sub (current_ir_graph, get_nodes_block(ivi->init),
492                                       ivi->cmp_const,sub_const);
493     } else
494       ivi->new_init = my_new_r_Sub (current_ir_graph, get_nodes_block(ivi->init),
495                                     ivi->new_init, sub_const);
496     if (get_opt_strength_red_verbose() && get_firm_verbosity() > 1) {
497       printf("\nReducing operation is : "); DDMN(reduce_var);
498       printf("in graph : "); DDMG(current_ir_graph);
499     }
500     return 1;
501   }
502   return 0;
503 }
504
505 static ir_node *reducible(ir_node *out, induct_var_info *ivi)
506 {
507   ir_node *reduced = NULL;
508   int pred;
509
510   for (pred = 1; pred == 1; pred = get_irn_n_outs(out)) {
511     if (reduce(out, ivi))
512       reduced = out;
513     else
514       return reduced;
515     out = get_irn_out(out, 0);
516   }
517   return reduced;
518 }
519
520 /**
521  * Reduce a node.
522  *
523  * @param *itervar_phi   The iteration variable of a loop.
524  * @param *env           Free environment pointer.
525  */
526 static void reduce_itervar(ir_node *itervar_phi, void *env)
527 {
528   induct_var_info ivi;
529
530   if (get_irn_op(itervar_phi) != op_Phi)
531     return;
532
533   ivi.itervar_phi = itervar_phi;
534
535   /* This "if" finds the iteration variable. */
536   if (is_induction_variable(&ivi)) {
537     int i, op_out;
538
539     for (i = 0; i < ivi.phi_pred; i++) {
540       ir_node *out = get_irn_out(ivi.itervar_phi, i);
541       ir_op   *out_op = get_irn_op(out);
542       if(ivi.reducible){
543         if(ivi.phi_pred == 3 && out != ivi.op && out !=ivi.cmp){
544           ir_node *reduced = reducible(out, &ivi);
545           if (reduced != NULL)
546             exchange( reduced, ivi.itervar_phi);
547         }
548       } else if (out_op == op_Mul)
549         if(reduce(out, &ivi) && ivi.reducible){
550           ir_node *reduced = reducible(ivi.reducible_node, &ivi);
551           if(reduced != NULL)
552             exchange(reduced, ivi.new_phi);
553           ivi.reducible = 0;
554           set_Phi_pred(ivi.new_phi, ivi.init_pred_pos, ivi.new_init);
555           set_irn_mode(ivi.new_phi,get_irn_mode(ivi.new_init));
556           set_irn_mode(ivi.new_op,get_irn_mode(ivi.new_phi));
557         }
558     }
559
560     op_out = get_irn_n_outs(ivi.op);
561     for (i = 0; i < op_out; i++){
562       ir_node *out = get_irn_out(ivi.op, i);
563       ir_op   *out_op = get_irn_op(out);
564       if(op_out == 2 && out != ivi.itervar_phi){
565         ir_node *reduced = reducible(out, &ivi);
566         if(reduced != NULL)
567           exchange( reduced, ivi.op);
568       }else if (out_op == op_Mul)
569         if(reduce(out, &ivi) && ivi.reducible){
570           ir_node *reduced = reducible(ivi.reducible_node, &ivi);
571           if(reduced != NULL)
572             exchange(reduced, ivi.new_phi);
573           ivi.reducible = 0;
574           set_Phi_pred(ivi.new_phi, ivi.init_pred_pos, ivi.new_init);
575           set_irn_mode(ivi.new_phi,get_irn_mode(ivi.new_init));
576           set_irn_mode(ivi.new_op,get_irn_mode(ivi.new_phi));
577         }
578     }
579
580     if(ivi.reducible){
581       if(get_irn_op(ivi.op) == op_Add)
582         if(get_Add_left(ivi.op) == ivi.itervar_phi)
583           set_Add_right(ivi.op, ivi.increment);
584         else
585           set_Add_left(ivi.op, ivi.increment);
586       else if(get_Sub_left(ivi.op) == ivi.itervar_phi)
587         set_Sub_right(ivi.op, ivi.increment);
588       else
589         set_Sub_right(ivi.op, ivi.increment);
590       set_Phi_pred(ivi.itervar_phi, ivi.init_pred_pos, ivi.init);
591       set_irn_mode(ivi.itervar_phi, get_irn_mode(ivi.init));
592       set_irn_mode(ivi.op, get_irn_mode(ivi.itervar_phi));
593       if (ivi.cmp != NULL){
594         set_irn_mode(ivi.cmp_const, get_irn_mode(ivi.itervar_phi));
595         if(get_Cmp_left(ivi.cmp) == ivi.itervar_phi)
596           set_Cmp_right(ivi.cmp, ivi.cmp_const);
597         else
598           set_Cmp_left(ivi.cmp, ivi.cmp_const);
599       }
600     }
601   }
602 }
603
604 /* Performs strength reduction for the passed graph. */
605 void reduce_strength(ir_graph *irg) {
606   ir_graph *rem = current_ir_graph;
607
608   if (!get_optimize() || !get_opt_strength_red()) return;
609
610   current_ir_graph = irg;
611
612   n_reduced_expressions = 0;
613   n_made_new_phis = 0;
614   /* -- Precompute some information -- */
615   /* Call algorithm that computes the backedges */
616   construct_cf_backedges(irg);
617   /* Call algorithm that computes the dominator trees. */
618   compute_doms(irg);
619   /* Call algorithm that computes the out edges */
620   compute_outs(irg);
621
622   /* -- Search expressions that can be optimized -- */
623   irg_walk_graph(irg, NULL, reduce_itervar, NULL);
624
625   if (get_opt_strength_red_verbose()) {
626     printf ("\n %d made new_phis und  ", n_made_new_phis);
627     printf("reduced %d iteration variables "
628            "in \n graph %s.%s.\n", n_reduced_expressions,
629        get_type_name(get_entity_owner(get_irg_entity(irg))),
630        get_entity_name(get_irg_entity(irg)));
631   }
632
633   current_ir_graph = rem;
634 }