Induction variable

Dear guys,

I am in need of discovering induction variables in loops. Does
LLVM provide a pass that already does this? For instance, given:

int a = 0, i;
for (i = 0; i < 10; i++) {
a += 5;

I would like to know that variable ‘a’ depends on variable ‘i’.

Thank you very much,


Take a look at lib/Analysis/ScalarEvolution*.