Value Range Propagation Pass Status

John Wehle john@feith.com
Fri Feb 4 16:05:00 GMT 2000


> I doubt there's much benefit in running it twice.  I suspect we can get 99%
> of the benefit by running it once, probably before loop.

Running a second time after loop occurred to me in order to handle
unnecessary condition jumps resulting from loop unrolling which I've
seen happen.  For example using -O2 -funroll-all-loops on a x86 platform
to compile:

  volatile int a;
  int b;

  int
  func()
  { 
    unsigned int i;
    i = 1;
    while (i & 1)
      {
        a = b;
        i += 2;
      }
    return 0;
  }

produces:

        pushl   %ebp
        movl    %esp, %ebp
        movl    $1, %edx
        movl    b, %eax
        .align 4
.L5:
        testl   $1, %edx
        movl    %eax, a
        je      .L7
        movl    %eax, a
        je      .L7
        movl    %eax, a
        je      .L7
        movl    %eax, a
        je      .L7
        movl    %eax, a
        je      .L7
        movl    %eax, a
        je      .L7
        movl    %eax, a
        je      .L7
        addl    $16, %edx
        testl   $1, %edx
        movl    %eax, a
        jne     .L5
.L7:
        xorl    %eax, %eax
        leave
        ret

There may be better answers.  I'll ignore this issue for now,
we can always choose to run it a second time later if it actually
ends up making sense.

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



More information about the Gcc mailing list