LLVM indvars pass

723 views Asked by At

I am using -indvars pass in LLVM. It says that is makes the loop counter start from 0 where it is possible. I used it for a simple loop, but its not making the loop count start from 0. Any idea why is it so?

The loop is

for(i=30;i<90;++i){
        a1[i]=i*2;
        a1[i]=a1[i]+1;;
}
1

There are 1 answers

0
coder hacker On BEST ANSWER

After some digging I found out that -indvars pass now don't canonicalize induction variable because most other passes now are made to work without need for canonical loops.

However my pass required that loops be in canonical form, so I found the old induction variable simplify pass and explicitly included in my file.

If someone is interested here is the old pass.