Hi.

Honza asked me to explain the change more verbosely. 
The patch simplify enhances verbose dump of IVOPTS so that
# of iterations is printed. Apart from that it also prints
invariant expression that are used during the algorithm which
considers a set of candidates which is improved.

Main motivation for doing this was that sometimes the optimization
considers a constant integer as invariant expression (Bin Cheng
is working on removal of these) and that both IVs and IE are considered
by the cost model to occupy a register. Which is not ideal and
it sometimes tend to introduce more IVs that one would expect.

=== New format ===:
Improved to:
  cost: 27 (complexity 2)
  cand_cost: 11
  cand_group_cost: 10 (complexity 2)
  candidates: 3, 5
   group:0 --> iv_cand:5, cost=(2,0)
   group:1 --> iv_cand:5, cost=(4,1)
   group:2 --> iv_cand:5, cost=(4,1)
   group:3 --> iv_cand:3, cost=(0,0)
   group:4 --> iv_cand:3, cost=(0,0)
  invariants 1, 6
  used invariant expressions:
   inv_expr:3:  ((sizetype) _976 - (sizetype) _922) * 4
   inv_expr:6:  ((sizetype) _1335 - (sizetype) _922) * 4


Original cost 27 (complexity 2)

Final cost 27 (complexity 2)

Selected IV set for loop 96 at original.f90:820, 5 avg niters, 2 expressions, 2 
IVs:

=== Before ===:

Improved to:
  cost: 27 (complexity 2)
  cand_cost: 11
  cand_group_cost: 10 (complexity 2)
  candidates: 3, 5
   group:0 --> iv_cand:5, cost=(2,0)
   group:1 --> iv_cand:5, cost=(4,1)
   group:2 --> iv_cand:5, cost=(4,1)
   group:3 --> iv_cand:3, cost=(0,0)
   group:4 --> iv_cand:3, cost=(0,0)
  invariants 1, 6

Original cost 27 (complexity 2)

Final cost 27 (complexity 2)

Selected IV set for loop 96 at original.f90:820, 2 IVs:


Martin

Reply via email to