[LLVMdev] [cfe-dev] RFC: Codifying (but not formalizing) the optimization levels in LLVM and Clang

Krzysztof Parzyszek kparzysz at codeaurora.org
Mon Jan 21 11:26:14 PST 2013

On 1/21/2013 1:00 PM, Michael Ilseman wrote:
> It's different in that optimizations here are passes to be ran, and fast-math is a semantic specifier. Currently, clang has fast-math support via a command-line argument (-ffast-math), which sets fath-math flags on individual LLVM IR instructions. Those flags don't govern the running or scheduling of passes, but provide (relaxed) semantics for the optimizations themselves to obey.

Ok, so maybe fast-math was a bad example.  Also, if the part of the 
discussion about inlining was only meant to be limited to -O[...], then 
I misunderstood it, and my concerns may not apply.

However, if we want to reflect things like optimization plans (i.e. more 
than just -O[0123], but things like "-Oparallel", for example) via 
attributes, then we do run into the issue of how inlining will interact 
with the attributes.  Both, parallelization and vectorization may 
require different sets of optimizations, and either of them may affect 
the semantics.  Will we be forced to have them happen before inlining? 
What about the "section" attribute?  Inlining a function from one 
section into a function from another section may not be what the user 


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation

More information about the llvm-dev mailing list