Hi <div><br></div><div>I am trying to write up a transformation for the following code where instead of incrementing the loop variable by 1, I increment it by 2 ie.</div><div><br></div><div>for (i=0; i < THRES; <b>i++</b>) {</div>
<div>  //do something </div><div>} </div><div><br></div><div>gets transformed to </div><div><br></div><div><div>for (i=0; i < THRES; <b>i+=2</b>) {</div><div>  //do something </div><div>} </div></div><div><br></div><div>
I am thinking of transforming the llvm  bit-code in the following way.</div><div>Iterate over the function for the original code till I get the basicBlock for the for loop, then iterate over the instructions till I get the increment instruction and then add the same increment instruction so that the increment happens twice. </div>
<div><br></div><div>I am still getting familiar with the llvm infrastructure and I am not sure if the above approach is even going to work. It'll be great if someone can suggest a better or more concrete way of doing the above transformation ? Is there already something similar in the source tree  that can I look up for ideas ?</div>
<div><br></div><div>Thanks!</div><div>Malveeka</div>