[LLVMdev] Optimization for size

Richard Osborne richard at xmos.com
Mon Oct 17 08:28:35 PDT 2011


On 17/10/11 15:58, James Molloy wrote:
>
> Hi,
>
> Looking at bugzilla PR11087, I’d like to conditionalise a 
> transformation in ARMIselLowering.cpp based on whether we’re compiling 
> for codesize or performance.
>
> -Os doesn’t actually exist for llc, and I can’t see an obvious place 
> where that condition would be set. Where do we specify if we’re 
> optimizing for codesize or performance?
>
> Cheers,
>
> James
>

You can specify a function should be optimized for size with the optsize 
function attribute. Given a MachineFunction you can check for this using:

bool OptSize = MF.getFunction()->hasFnAttr(Attribute::OptimizeForSize);

-- 
Richard Osborne | XMOS
http://www.xmos.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111017/5ad63e5a/attachment.html>


More information about the llvm-dev mailing list