Induction Variables

LLVM,

What is the status of the InductionVariable "semi-pass"? I have tested
it out on spec benchmarks, and while it does correctly identify some of
the variables, it fails to recognize most. Typically the following
scenario arises

a_loop:
...
%tmp.19 = load int* %bsLive
%tmp.20 = add int %tmp.19, -8
store int %tmp.20, int* %bsLive
%tmp.5 = setgt int %tmp.20, 0
br bool %tmp.5, label a_loop, label a_exit

a_exit:

Is there any way to force this variable to stay in a register, such that
it is handled with a phi node, and recognized by the InductionVariable
class?

Thanks,
Dave

What is the status of the InductionVariable "semi-pass"? I have tested
it out on spec benchmarks, and while it does correctly identify some of
the variables, it fails to recognize most. Typically the following
scenario arises

The -indvars pass promote simple induction variables that only live in
registers.

a_loop:
...
%tmp.19 = load int* %bsLive
%tmp.20 = add int %tmp.19, -8
store int %tmp.20, int* %bsLive
%tmp.5 = setgt int %tmp.20, 0
br bool %tmp.5, label a_loop, label a_exit

a_exit:
Is there any way to force this variable to stay in a register, such that
it is handled with a phi node, and recognized by the InductionVariable
class?

In this case, try running the -licm pass, which will promote that memory
location to be a register in the body of the loop, as long as there are
not may-aliased stores inside of the loop. You can play around with the
different AA implementations if the simple default one isn't good enough
(but if you just have one must-aliased store like above there should
obviously be no problem.

More info on the AA stuff is here:
http://llvm.cs.uiuc.edu/docs/AliasAnalysis.html

-Chris