Re: Compiler Loop Unswitching



Tim Frink <plfriko@xxxxxxxx> wrote:

Could you explain what you mean with "first compare"? Maybe you could
provide a small code example?

The comparison on the first iteration of the loop. For example, in:

for (i = 0; i < 10; i++)

You know that i will be 0 and thus < 10 on the first iteration of the
loop, so there's no need to actually test the condition before executing
the loop body.

-Larry Jones

I like Mom to be impressed when I fulfill the least of my obligations.
-- Calvin
.



Relevant Pages

  • Re: basic python question about for loop
    ... what is happening in the first iteration of the first enclosing for loop. ... Trace through the code; see that 2 is bound to n in the first iteration; see ... your loop is perfectly correct. ... number of possible divisors satisfying this condition is an empty set. ...
    (comp.lang.python)
  • Re: IF Statment and Code Question
    ... I am using an IF statment to try ... and store the min and max values of a growing variable and I am having ... This will only happen for the first iteration as the next will either ... end%outter for loop ...
    (comp.soft-sys.matlab)
  • Re: Problem using a for loop to delete rows and columns from a matrix.
    ... Basically I have an NxN matrix, and I have a vector of length M. ... What happens after the first iteration through the inner loop? ... deletion process. ...
    (comp.soft-sys.matlab)
  • Re: why I dont like range/xrange
    ... Bruno Desthuilliers schreef: ... Then, before starting the second iteration, i is incremented to 11; then the loop condition is checked and results in false. ... So the loop terminates after the first iteration. ... So, the point is that in C you can influence the loop's behavior by modifying the loop variable, while you cannot do that in Python. ...
    (comp.lang.python)
  • Re: List problem
    ... Thomas M. web.de> writes: ... Maybe this will help illustrate the problem: ... On the first iteration of the loop, you are looking at item 0 in a 3-item list, ... When the for loop continues, it is now looking at index 1, and the item at index ...
    (comp.lang.python)