<div dir="ltr">On 22 June 2013 00:39, Ye, Mei <span dir="ltr"><<a href="mailto:Mei.Ye@amd.com" target="_blank">Mei.Ye@amd.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">






<div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div>
<p class=""><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">On the other hand, what’s the policy to check in if a specific opt is not enabled by default?</span><br></p></div></div></blockquote>
<div><br></div><div>Regarding the compiler flags, just look for: "static cl::opt<" and you'll see all valid options, hidden or not, and if they're enabled by default or not. </div><div><br></div><div>
Example:</div><div><br></div><div><div>static cl::opt<bool> UseNewSROA("use-new-sroa",<br></div><div>  cl::init(true), cl::Hidden,</div><div>  cl::desc("Enable the new, experimental SROA pass"));</div>
</div><div><br></div></div></div><div class="gmail_extra">If you want to know what passes are enabled on certain optimizations levels from Clang, search for "CodeGenOpts.OptimizationLevel".</div><div class="gmail_extra">
<br></div><div class="gmail_extra">Unfortunately, there isn't a document yet of what gets enabled at which optimization level, or with what flag, since there isn't an automatic way of documenting all the flags and their status and descriptions into nice webpages, like GCC. Though, flags declaration (cl::opt) do create a nice description on the command-line help.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">It should be possible to add some call-backs on the PassRegistry to document what goes where, maybe even at compile time with template magic. But I'm not sure there are many people interested in doing or maintaining this...</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">--renato</div></div>