[LLVMdev] CodeGenOpt
Devang Patel
dpatel at apple.com
Thu Feb 24 08:57:13 PST 2011
On Feb 24, 2011, at 8:14 AM, David A. Greene wrote:
> Chris Lattner <clattner at apple.com> writes:
>
>>> class CodeGenOpt {
>>> ...
>>> public
>>> getOptLevel() ...;
>>> getFPLevel() ...;
>>> getMemLevel() ...;
>>> };
>>>
>>> Does this sound reasonable?
>>
>> I don't think that this is the right way to go. Higher level
>> decisions like that should affect your choice of passes to schedule.
>
> But there's no way to do that at the codegen level. LLVMTargetMachine
> keys off of CodeGenOpt.
If you look at addCommonCodeGenPasses() then you'll see that CodeGenOpt is not used to select passes. Yes, CodeGenOpt::None is checked at few places to ensure that we are doing optimization, but it is not checking *level* of optimization.
If seems you want better approach to influence pass selection in addCommonCodeGenPasses() for your needs. If so, why not try to do what we did in 'opt' using StandardPasses.h ? (Note, I have not thought through this suggestion, I am just thinking loudly here)
-
Devang
More information about the llvm-dev
mailing list