This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [autovect] [patch] vectorize in cases when number of iterations may be zero



gcc-patches-owner@gcc.gnu.org wrote on 15.06.2006 21:38:02:

> Victor Kaplansky wrote:
> >>> 2. The patch makes expr_invariant_in_loop_p to consider DECL
> > expressions to
> >>> consider as loop-invariant.
> >> Uh, well that would be very wrong :)
> >>
> >> You'd need to verify it's not actually set in the loop.
> >
> > Probably I'll need some help to do it right way. The actuall expression
> > which is passed to expr_invariant_in_loop_p looks like this:
> >
> > at /home/victork/autovect/gcc/gcc/tree-data-ref.c:1036
> > 1036      if (!expr_invariant_in_loop_p (loop, init))
> > (gdb) p debug_generic_expr (init)
> >
> > &input_bufD.1868[(<unnamed type>) lagD.18880_550]
> >
>
> This is not invariant if lag is not invariant.
> Otherwise, it is, but only because it's an address expression.

lag is invariant, but expr_invariant_in_loop_p returns false for whole
expression.
The problem is with input_buf:

1372      if (is_gimple_min_invariant (expr))
(gdb) p debug_generic_expr (expr)
input_bufD.1868
$7 = void
(gdb) p debug_tree (expr)
 <var_decl 0xf7fc93f0 input_buf
    type <array_type 0xf7fd1888
        type <integer_type 0xf7fa4208 e_s16 sizes-gimplified public HI
            size <integer_cst 0xf7ee2360 constant invariant 16>
            unit size <integer_cst 0xf7ee2380 constant invariant 2>
            align 16 symtab 0 alias set -1 precision 16 min <integer_cst
0xf7ee22e0 -32768> max <integer_cst 0xf7ee2320 32767> context
<translation_unit_decl 0xf7ba5a00 D.11557>
            pointer_to_this <pointer_type 0xf7fb5c30>>
        BLK
        size <integer_cst 0xf7fad1c0 constant invariant 256>
        unit size <integer_cst 0xf7ee2140 constant invariant 32>
        align 16 symtab 0 alias set 61
        domain <integer_type 0xf7f49dd0 type <integer_type 0xf7ee9138
unsigned int>
            sizes-gimplified public SI
            size <integer_cst 0xf7ee24a0 constant invariant 32>
            unit size <integer_cst 0xf7ee2160 constant invariant 4>
            align 32 symtab 0 alias set -1 precision 32 min <integer_cst
0xf7ee2180 0> max <integer_cst 0xf7ee26c0 15>>
        pointer_to_this <pointer_type 0xf7fd4548>>
    addressable used static BLK file telecom/autcor00/bmark.c line 201 size
<integer_cst 0xf7fad1c0 256> unit size <integer_cst 0xf7ee2140 32>
    align 16 context <translation_unit_decl 0xf7fc1480 D.1929> initial
<constructor 0xf7fcbb88> chain <var_decl 0xf7fc9460 test_buf>>
$8 = void

and expr_invariant_in_loop_p return false for expr=input_bufD.1868 by the
following lines:
   1388
   1389   if (!EXPR_P (expr))
   1390     return false;
   1391

-- Victor


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]