[LLVMdev] getCanonicalInductionVariable

Arushi Aggarwal arushi987 at gmail.com
Sat May 21 18:45:02 PDT 2011


Hi,

What does your LLVM IR look like. Are you sure the loop hasnt been optimized
away?

Arushi

On Sat, May 21, 2011 at 5:52 PM, Malveeka Tewari <mtewari at eng.ucsd.edu>wrote:

> Hi
>
> I have the followed code for which I am writing a loop pass.
>
> int main() {
>   int i = 0;
>   for (i=0; i<20; i++) {
>     printf ("hello world %d\n", i);
>   }
>   return 0;
> }
>
> In the function runOnLoop, I have the following instruction
> PHINode *indv = NULL;
> indv = L->getCanonicalInductionVariable();
>
> However, when I check indv is always set to NULL.
> Since the code has a canonical induction variable, I was expecting the endv
> to start pointing to the induction var phi node.
>
> Please let me what I'm missing here
>
> Thanks
> Malveeka
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110521/ad997fae/attachment.html>


More information about the llvm-dev mailing list