|Type demotion of induction variable for address calculation firstname.lastname@example.org (shrey) (2010-06-23)|
|Date:||Wed, 23 Jun 2010 21:17:44 -0700 (PDT)|
|Keywords:||analysis, optimize, question|
|Posted-Date:||25 Jun 2010 16:25:39 EDT|
I wish to explore the scenarios when the type of an induction
variable used say to index A[i[ in a loop can be demoted to a short.
The motivation being it would aid in an efficient code using 16 bit
multiplies instead of needing 32 bit multiplies for the target.
So far I can see the following cases
1. Size of A is less than 2^32 and assuming the source does not do out
of array access. Does c99 provide such guarrantees ?
2. the maximum value of i is less that 2^16/ sizeof(A[i])
Size of A[i] is size of element.
Is my reasoning valid ? And are there other scenarios ?
Also can some one point to me any such existing work ?
Return to the
Search the comp.compilers archives again.