From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hayes To: law@cygnus.com Cc: Michael Hayes , egcs@cygnus.com Subject: Re: Re-run of loop pass Date: Sun, 18 Oct 1998 03:11:00 -0000 Message-id: <13865.44885.953349.460182@ongaonga.elec.canterbury.ac.nz> References: <13865.9178.455954.70561"@ongaonga.elec.canterbury.ac.nz> <18798.908694891@hurl.cygnus.com> X-SW-Source: 1998-10/msg00680.html Jeffrey A Law writes: > You should investigate why the second loop pass is unable to determine > loop iteration counts. Consider a simple dot product function like the following: float foo(float *a, float *b) { int i; float result = 0.0; for (i = 0; i < 4; i++) result += a[i] * b[i]; return result; } The first pass often eliminates the BIV associated with i and replaces the end of loop test i < 4 with a comparison of the incremented pointer associated with a + i with a + 4 (I think the elimination is only performed for targets with autoincrement addressing modes). The second pass then finds that the initial value of BIV associated with a is not a constant and thus cannot determine the iteration count. I imagine that the information regarding iteration counts should be gathered on the first pass and then used on the second pass if needed. Michael.