- }
- }
-
- /* Print some informations about the list. */
- for (entry = heavy_uses; entry; entry = entry->next) {
- printf("\nweight: is %f\n", entry->weight);
- ir_printf("Call for Method %E\n", entry->t.ent);
- printf("Position %i\n", entry->t.pos);
- ir_printf("Value %T\n", entry->t.tv);
- }
-
- /* "new_entrys" contain already optimized Calls, that muss
- be optimized again, why we can optimize just one constan
- parameter at once and when a Call have to constant parameters
- the algorithm muss be repeated, but we don't need to walk over
- the graph again.*/
- new_entrys = new_set(entry_cmp, 8);
-
- for (entry = heavy_uses; entry; entry = entry->next) {
- count = set_count(new_entrys);
- /* The new cloned method shoul be made.*/
- entity *ent = clone_method(&entry->t);
-
- /* The new Call for the new methode should be made.*/
- new_call = new_cl_Call(entry->t.call, ent, entry->t.pos);
-
- /* A call node in the graph is the head of a list, that contains all
- * clons lf this graph. The "new_call" must be inherits this list.*/
- set_irn_link(new_call, get_irn_link(entry->t.call));
-
- exchange(entry->t.call, new_call);
- /* We set the new Call in the set "new_entrys" if it
- have constant parameter.*/
- collect_irg_calls(new_call, new_entrys);
- /* We muss exchange the copies ot this call in all clones too.*/
- exchange_calls(new_call, ent, entry->t.pos);
- }
- /* The "Calls" in the set "set_entrys" are optimized. */
- del_set(set_entrys);
- set_entrys = new_set(entry_cmp, 8);
- /* The set "set_entrys" must contain the new "Calls" to optimize t.m.
- we must copy all entys of "new_entrys" to "set_entrys"*/
- ITERATE_SET(new_entrys, entry) {
- key.t.ent = entry->t.ent;
- key.t.pos = entry->t.pos;
- key.t.tv = entry->t.tv;
- key.t.call = entry->t.call;
- key.num_calls = 0;
-
- set_insert(set_entrys, &key, sizeof(key), hash_entry(&key));
- }
- del_set(new_entrys);
- entry = NULL;
- heavy_uses = NULL;
- }