410 |
410 |
411 // Helper functions for Split() |
411 // Helper functions for Split() |
412 uint split_DEF( Node *def, Block *b, int loc, uint max, Node **Reachblock, Node **debug_defs, GrowableArray<uint> splits, int slidx ); |
412 uint split_DEF( Node *def, Block *b, int loc, uint max, Node **Reachblock, Node **debug_defs, GrowableArray<uint> splits, int slidx ); |
413 uint split_USE( Node *def, Block *b, Node *use, uint useidx, uint max, bool def_down, bool cisc_sp, GrowableArray<uint> splits, int slidx ); |
413 uint split_USE( Node *def, Block *b, Node *use, uint useidx, uint max, bool def_down, bool cisc_sp, GrowableArray<uint> splits, int slidx ); |
414 |
414 |
415 bool clone_projs(Block *b, uint idx, Node *con, Node *copy, LiveRangeMap &lrg_map) { |
|
416 bool found_projs = clone_projs_shared(b, idx, con, copy, lrg_map.max_lrg_id()); |
|
417 |
|
418 if(found_projs) { |
|
419 uint max_lrg_id = lrg_map.max_lrg_id(); |
|
420 lrg_map.set_max_lrg_id(max_lrg_id + 1); |
|
421 } |
|
422 |
|
423 return found_projs; |
|
424 } |
|
425 |
|
426 //------------------------------clone_projs------------------------------------ |
415 //------------------------------clone_projs------------------------------------ |
427 // After cloning some rematerialized instruction, clone any MachProj's that |
416 // After cloning some rematerialized instruction, clone any MachProj's that |
428 // follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants |
417 // follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants |
429 // use G3 as an address temp. |
418 // use G3 as an address temp. |
430 bool clone_projs(Block *b, uint idx, Node *con, Node *copy, uint &max_lrg_id) { |
419 int clone_projs(Block* b, uint idx, Node* orig, Node* copy, uint& max_lrg_id); |
431 bool found_projs = clone_projs_shared(b, idx, con, copy, max_lrg_id); |
420 |
432 |
421 int clone_projs(Block* b, uint idx, Node* orig, Node* copy, LiveRangeMap& lrg_map) { |
433 if(found_projs) { |
422 uint max_lrg_id = lrg_map.max_lrg_id(); |
434 max_lrg_id++; |
423 int found_projs = clone_projs(b, idx, orig, copy, max_lrg_id); |
|
424 if (found_projs > 0) { |
|
425 // max_lrg_id is updated during call above |
|
426 lrg_map.set_max_lrg_id(max_lrg_id); |
435 } |
427 } |
436 |
|
437 return found_projs; |
428 return found_projs; |
438 } |
429 } |
439 |
|
440 bool clone_projs_shared(Block *b, uint idx, Node *con, Node *copy, uint max_lrg_id); |
|
441 |
430 |
442 Node *split_Rematerialize(Node *def, Block *b, uint insidx, uint &maxlrg, GrowableArray<uint> splits, |
431 Node *split_Rematerialize(Node *def, Block *b, uint insidx, uint &maxlrg, GrowableArray<uint> splits, |
443 int slidx, uint *lrg2reach, Node **Reachblock, bool walkThru); |
432 int slidx, uint *lrg2reach, Node **Reachblock, bool walkThru); |
444 // True if lidx is used before any real register is def'd in the block |
433 // True if lidx is used before any real register is def'd in the block |
445 bool prompt_use( Block *b, uint lidx ); |
434 bool prompt_use( Block *b, uint lidx ); |