Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 1 | From a28768eec0a9d5137196bed8e8c6d284cf4c3cbc Mon Sep 17 00:00:00 2001 |
| 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> |
| 3 | Date: Tue, 17 Jan 2017 17:33:31 +0530 |
| 4 | Subject: [PATCH 23/54] [Patch] OPT: Update heuristics for loop-invariant for |
| 5 | address arithme. .tic. |
| 6 | |
| 7 | The changes are made in the patch to update the heuristics |
| 8 | for loop invariant for address arithmetic. The heuristics is |
| 9 | changed to calculate the estimated register pressure cost when |
| 10 | ira based register pressure is not enabled. The estimated |
| 11 | register pressure cost modifies the existing calculation cost |
| 12 | associated to perform the Loop invariant code motion for address |
| 13 | arithmetic. |
| 14 | |
| 15 | ChangeLog: |
| 16 | 2015-06-17 Ajit Agarwal <ajitkum@xilinx.com> |
| 17 | Nagaraju Mekala <nmekala@xilinx.com> |
| 18 | |
| 19 | * loop-invariant.c (gain_for_invariant): update the |
| 20 | heuristics for estimate_reg_pressure_cost. |
| 21 | |
| 22 | Signed-off-by:Ajit Agarwal ajitkum@xilinx.com |
| 23 | Nagaraju Mekala nmekala@xilinx.com |
| 24 | --- |
| 25 | gcc/loop-invariant.c | 6 ++---- |
| 26 | 1 file changed, 2 insertions(+), 4 deletions(-) |
| 27 | |
| 28 | diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c |
| 29 | index bd31a51..8e22ca0 100644 |
| 30 | --- a/gcc/loop-invariant.c |
| 31 | +++ b/gcc/loop-invariant.c |
| 32 | @@ -1466,10 +1466,8 @@ gain_for_invariant (struct invariant *inv, unsigned *regs_needed, |
| 33 | |
| 34 | if (! flag_ira_loop_pressure) |
| 35 | { |
| 36 | - size_cost = (estimate_reg_pressure_cost (new_regs[0] + regs_needed[0], |
| 37 | - regs_used, speed, call_p) |
| 38 | - - estimate_reg_pressure_cost (new_regs[0], |
| 39 | - regs_used, speed, call_p)); |
| 40 | + size_cost = estimate_reg_pressure_cost (regs_needed[0], |
| 41 | + regs_used, speed, call_p); |
| 42 | } |
| 43 | else if (ret < 0) |
| 44 | return -1; |
| 45 | -- |
| 46 | 2.7.4 |
| 47 | |