[LLVMdev] Proposal : Function Notes

Nick Kledzik kledzik at apple.com
Mon Aug 25 23:02:21 PDT 2008

On Aug 25, 2008, at 4:03 PM, Devang Patel wrote:
>> These seem like great default parameters for code-gen, but looking  
>> forward, if we also allowed some optimization flags to be specified  
>> at LTO time, how would they interact?
> The flags specified on the linker command line during LTO are not  
> encoded into llvm IR. However, IMO,  these linker command line flags  
> should override notes encoded in llvm IR. We may have to handle  
> special cases, but we should document linker's decision choices  
> properly.

It is not clear to me which should override which.

For instance, instance, if I compiled with -Os or -O3 then I am  
forcing the codegen model at compile time, and the function IR would  
have the appropriate opt-size or opt-speed note.  But if I specify  
neither at llvm-gcc time, the function IR should have neither opt-size  
or opt-speed note.   At LTO time, I could specify -Os or -O3 (or  
equivalent) and it would make sense that the optimizer would use the  
opt-size or opt-speed from each function if there, or if none, inherit  
the default optimization goal from the link line.


More information about the llvm-dev mailing list