Hi,<br><br>I am trying to add a new loop pass in which I making a call to get the trip count of the loop using<br><br>Value *TripCountValue = L->getTripCount()<br><br>However I am always getting NULL for TripCountValue (confirmed through gdb). I am running this pass after the canonicalization of induction variables:<br>
<br>opt --debug-pass=Structure -stats -indvars -loop-rotate -my-loop-pass < main.bc > main.unroll.s<br>Pass Arguments:  -domtree -loops -scalar-evolution -loopsimplify -domfrontier -scalar-evolution -lcssa -indvars -loop-rotate -domfrontier -scalar-evolution -lcssa -my-loop-pass -preverify -domtree -verify<br>
Target Data Layout<br>  ModulePass Manager<br>    FunctionPass Manager<br>      Dominator Tree Construction<br>      Natural Loop Construction<br>      Scalar Evolution Analysis<br>--      Scalar Evolution Analysis<br>      Canonicalize natural loops<br>
      Dominance Frontier Construction<br>      Scalar Evolution Analysis<br>      Loop Pass Manager<br>        Loop-Closed SSA Form Pass<br>        Canonicalize Induction Variables<br>--        Canonicalize Induction Variables<br>
        Rotate Loops<br>--        Loop-Closed SSA Form Pass<br>--        Rotate Loops<br>--      Dominance Frontier Construction<br>--      Scalar Evolution Analysis<br>      Dominance Frontier Construction<br>      Scalar Evolution Analysis<br>
      Loop Pass Manager<br>        Loop-Closed SSA Form Pass<br><b>        <My Loop Pass></b><br>--       <b> <My Loop Pass></b><br>--        Loop-Closed SSA Form Pass<br>--      Natural Loop Construction<br>--      Canonicalize natural loops<br>
--      Dominance Frontier Construction<br>--      Dominator Tree Construction<br>--      Scalar Evolution Analysis<br>      Preliminary module verification<br>      Dominator Tree Construction<br>      Module Verifier<br>
--      Preliminary module verification<br>--      Dominator Tree Construction<br>--      Module Verifier<br>    Bitcode Writer<br>--    Bitcode Writer<br><br>I have two loops in my source program which have statically-determinable bounds:<br>
<br>for (i=1; i < 99999; i++)<br>{<br>....<br>}<br><br>Is there anything else I should be doing before invoking the getTripCount() method ?<br><br>thanks,<br>Prakash