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

Chris Lattner sabre at nondot.org
Fri Jun 16 10:23:48 PDT 2006


On Fri, 16 Jun 2006, Silken Tiger wrote:
> Hi Chris and llvm list
>
> Thanks for your answer.
>> 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.
> Ok, after combining all your comments in this thread and reading the
> documentation again. I think i figured it out:
> Every Pass is allowed to depend on the same granularity (eg. ModulePass
> on ModulePass) or coarser (eg. BasicBlockPass on Functionpass but *NOT*
> the other way round).

Exactly.

> So my here goes my problem: Since my C-Backend modified pass is a module
> pass i can only depend on module passes. This stands in contrary to the
> proposed way to use the most apropriate (BasicBlock in my case) pass available.

Right.

> Since there is no way for me in using this pass?

Why not just define it as a module pass, then iterate over functions and 
bb's yourself?

-Chris

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



More information about the llvm-dev mailing list