Question about Doloop

Revital1 Eres ERES@il.ibm.com
Sun Sep 5 11:46:00 GMT 2010


Hello,

Doloop optimization fails to be applied on the following inner loop
when compiling for PowerPC  (GCC -r162294) due to:

Doloop: number of iterations too costly to compute.

I do not understand why as the number of iterations is max_cols and I
appreciate an explanation.

Thanks,
Revital

 11   while (--max_rows >= 0)
 12     {
 13       inptr = *inbuf++;
 14       outp = outbuf[0][rows];
 15       rows++;
 16
 17       for (y = 0; y < max_cols; y++)
 18         {
 19           k = ((int) (inptr[0]));
 20           inptr += 3;
 21
 22           outp[y] = (unsigned char) ((inarr[k]) >> 16);
 23         }
 24     }


>From Doloop dump:

Analyzing operand (reg/f:DI 246 [ D.2082 ]) of insn (insn 118 116 119 5
test1.c:17 (set (reg:CC 272)
        (compare:CC (reg/v/f:DI 199 [ inptr ])
            (reg/f:DI 246 [ D.2082 ]))) 535 {*cmpdi_internal1}
(expr_list:REG_DEAD (reg/f:DI 246 [ D.2082 ])
        (nil)))
  invariant (reg/f:DI 246 [ D.2082 ]) (in DI)
Loop 2 is simple:
  simple exit 5 -> 6
  number of iterations: (mult:DI (plus:DI (minus:DI (reg/f:DI 246
[ D.2082 ])
            (reg/v/f:DI 199 [ inptr ]))
        (const_int -3 [0xfffffffffffffffd]))
    (const_int -6148914691236517205 [0xaaaaaaaaaaaaaaab]))
  upper bound: -1
Doloop: number of iterations too costly to compute.


 (See attached file: test1.c)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test1.c
Type: application/octet-stream
Size: 495 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20100905/07e0cae5/attachment.obj>


More information about the Gcc mailing list