Architectures like Mips are very limited when it comes to addressing modes. 
Therefore, the expected
behavior would be that, for the BASE + OFFSET addressing mode, complexity is 
lower, while, for more
complex addressing modes (e.g. BASE + INDEX << SCALE), which are not supported, 
complexity is
higher. Currently, the complexity calculation algorithm bails out if BASE + 
INDEX addressing mode
is not supported by the target architecture, resuling in 0-complexities for all 
candidates, which
leads to non-optimal candidate selection, especially in scenarios where there 
are multiple nested
loops.

Additionally, when bumping up the register pressure cost, the number of 
invariants should also be
considered, in addition to the number of candidates.

Dimitrije Milosevic (2):
  ivopts: Revert computation of address cost complexity.
  ivopts: Consider number of invariants when calculating register pressure.

 gcc/tree-ssa-address.cc     |   2 +-
 gcc/tree-ssa-address.h      |   2 +
 gcc/tree-ssa-loop-ivopts.cc | 220 +++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 210 insertions(+), 14 deletions(-)
---
2.25.1


Reply via email to