[LLVMdev] Adding an object to llc (analysis pass)

Chris Lattner sabre at nondot.org
Thu Jun 1 10:09:15 PDT 2006


On Thu, 1 Jun 2006, Silken Tiger wrote:
>> Right it does.  However, does something *else* require MParSchedule?  If
>> so, what?
> Ok, i am writing on a different backend based on the cbackend.

Ok.

> The test usage of this pass looks like this:
>
> void getAnalysisUsage(AnalysisUsage &AU) const {
>      AU.addRequired<LoopInfo>();
>      AU.addRequired<MParSchedule>();
>      AU.setPreservesAll();
> }
>
> and then in the runOnFunction pass of this backend:
> LI = &getAnalysis<LoopInfo>();
> MParSchedule &MPar = getAnalysis<MParSchedule>();

So again, this is the problem I described earlier:  you have a pass 
(MParSchedule) which is a basic block pass.  This pass is being required 
by another pass (your C backend-based thing) which is not a basic block 
pass.  This is the problem, please see the "how to write a pass" doc.  The 
fix is to change MParSchedule to be a function pass or modulepass.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list