------- Comment #26 from davidxl at gcc dot gnu dot org 2010-08-31 17:45 ------- Good observation re. the number of IVs in the final set. This usually points to some problem/bug in the cost function. I briefly looked at this case -- it indeed exposes two more bugs in the cost model:
1) the computation cost of the all the cost pairs in an assignment can actually not simply be added together, because many rewrite expressions can be commoned. We now have the mechanism to compute with common loop invariants for register pressure estimation, and this mechnasim needs to be extended for computation cost. 2) the offset is not stripped when computing loop invariant expression ids -- this can cause problem in overestimating reg pressure. (The case arises more often with loop unrolling). David -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45422