[LLVMdev] getTripCount requires which optimization passes?

Trevor Harmon trevor.w.harmon at nasa.gov
Fri May 7 11:17:33 PDT 2010


On May 6, 2010, at 6:32 PM, ether zhhb wrote:

> As the comment said:
>   /// The IndVarSimplify pass transforms loops to have a form that  
> this
>   /// function easily understands.
>
> you could try -indvars.

After adding -indvars to the opt command, getTripCount still returns  
null.

I suppose it's possible, depending on the scheduling of the pass  
manager, that indvars is running after my pass runs. I could force it  
to run first by adding it to my pass's getAnalysisUsage:

void MyPass::getAnalysisUsage(AnalysisUsage &AU) const {
     AU.addRequired<IndVarSimplify>();
}

But this isn't possible because for some reason there's no  
IndVarSimplify.h header file. The IndVarSimplify pass is defined only  
in its IndVarSimplify.cpp, so my pass can't use it.

Not sure where to go from here. Should I post a test case illustrating  
the problem?

Trevor




More information about the llvm-dev mailing list