[LLVMdev] PassManager Error

Devang Patel dpatel at apple.com
Fri Jul 27 13:15:37 PDT 2007


On Jul 26, 2007, at 11:25 AM, David Greene wrote:

> On Thursday 26 July 2007 11:48, Devang Patel wrote:
>
>> If in register allocator you have requested another higher level pass
>> after LiveVariableAnalysis pass then this may happen.
>
> Can you explain why this is so?  I would assume that I could  
> declare Pass
> dependencies in any order.  The manual certainly doesn't say  
> anything about
> restricions like this.  Shouldn't a Pass just be a Pass that can be  
> run?

A pass is not just a pass. It depends on the the level it operates  
on. A function level pass operates on all functions and a module  
level pass works on entire module. For example,

If pass sequence is - ModuleLevelPass A, FunctionLevelPass B,  
FunctionLevelPass C, ModuleLevelPass D then

For each Module
	run ModuleLevelPass A
	for each function in this module
		run FunctionLevelPass B
		run FunctionLevelPass C
	run ModuleLevelPass D
	

Now, if pass sequence is - ModuleLevelPass A, FunctionLevelPass B,   
ModuleLevelPass D, FunctionLevelPass C then

For each Module
	run ModuleLevelPass A
	for each function in this module
		run FunctionLevelPass B
	run ModuleLevelPass D
	for each function in this module
		run FunctionLevelPass C


In this situation, while processing 'foo' FunctionLevelPass C can not  
use analysis info generated by FunctionLevelPass B for 'foo'.

So if FunctionLevelPass C is requiring FunctionLevelPass B and  
ModuleLevelPass D in that order then you may see mentioned  
assertions. I just checked in patch to help investigate such  
failures. Add --debug-pass=Structure on the 'opt' command line to  
understand what is going on.

I welcome patches to update manual to explain this clearly.

-
Devang




More information about the llvm-dev mailing list