[LLVMdev] getSmallConstantTripCount problem

Michael Ilseman michael.ilseman at gmail.com
Thu Apr 28 13:49:46 PDT 2011


Did you run the IndVarSimplify pass? For things like canonical
inductive variables and trip counts, LoopInfo seems to rely on the
loop already being in a canonical form presented by passes such as
IndVarSimplify. You'll also want to make sure not to do something like
StrengthReduction which will invalidate the canonicalization done by
IndVarSimplify until you're done with the LoopInfo analysis.

On Wed, Apr 27, 2011 at 1:35 PM, Bo Wu <bwu at cs.wm.edu> wrote:
> In my pass, I add LoopInfo as a required pass. Then I'd like to print the
> constant loop trip count of each loop if it has one. However, every time I
> call loop->
> getSmallConstantTripCount(), it returns 0, even for a very simple loop:
> for(i=0; i<3; ++i) {;}  What's the possible cause of this problem?
>
> regards,
> Bo
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list