[cfe-dev] PassManagerBuilder vs. TargetPassConfig

Philip Reames listmail at philipreames.com
Tue Sep 9 20:07:38 PDT 2014


On 09/09/2014 07:14 AM, Yaron Keren wrote:
> Hi,
>
> clang uses PassManagerBuilder via EmitAssemblyHelper::CreatePasses() 
> to create a collection of passes.
>
> llvm (MCJIT) uses TargetPassConfig via addPassesToGenerateCode for the 
> same purpose.
>
> There seems to some duplication and many differences 
> between PassManagerBuilder and TargetPassConfig, some aren't clear at all.
>
> Two small examples:
>
> 1) PassManagerBuilder adds createScalarReplAggregatesPass 
> but TargetPassConfig does not.
>
> 2)  TargetPassConfig adds createLoopStrengthReducePass right after the 
> initial analysis but TargetPassConfig  does not.
>
> I would expect that the optimization passes would be identical based 
> on optimization level only but they are quite different 
> between PassManagerBuilder and TargetPassConfig.
I'm not aware of any reason these two should differ.  I suspect this is 
simply a case of copied code which has devolved over time.

Philip



More information about the cfe-dev mailing list