[LLVMdev] No getSmallConstantTripCount function in current LLVM version

Andrew Trick atrick at apple.com
Mon May 21 21:42:05 PDT 2012


On May 21, 2012, at 1:20 PM, Han Li <lihan9088 at gmail.com> wrote:

> Hi, 
> 
> I cannot find the getSmallConstantTripCount function in the current LLVM. Can anyone tell me whether there is still such a function to get the trip count in LLVM?

 Hi Han Li,

     AU.addRequired<ScalarEvolution>();
     AU.addPreserved<ScalarEvolution>();

    ScalarEvolution *SE = &getAnalysis<ScalarEvolution>();
    SE->getSmallConstantTripCount(L, ExitingBlock);

If you only want to handle single exit loops then:
   ExitingBlock = L->getExitingBlock()


-Andy



More information about the llvm-dev mailing list