<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 7/10/2017 8:55 AM, Sumanth
Gundapaneni via llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:03a101d2f994$f961d4e0$ec257ea0$@codeaurora.org">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">The clang flag “-fno-jump-table” adds the
function attribute “no-jump-table=true” to IR.<o:p></o:p></p>
<p class="MsoNormal">What are facts that need to take in to
consideration whether to pass an llvm flag to the clang driver
(assuming we have an llvm flag that turns off jump tables ) vs
adding an attribute?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
<br>
There are essentially four ways to change the way code generation
works for a function:<br>
<br>
1. Function attributes
(<a class="moz-txt-link-freetext" href="http://llvm.org/docs/LangRef.html#function-attributes">http://llvm.org/docs/LangRef.html#function-attributes</a>)<br>
2. Module flags
(<a class="moz-txt-link-freetext" href="http://llvm.org/docs/LangRef.html#module-flags-metadata">http://llvm.org/docs/LangRef.html#module-flags-metadata</a>)<br>
3. Options passed directly to the target
(include/llvm/Target/TargetOptions.h etc.)<br>
4. LLVM flags ("-mllvm").<br>
<br>
Historically, LLVM flags were the primary way to configure the
compiler; they're very easy to add, and straightforward to use. But
they don't really work well if you aren't just invoking a compiler
to build an object file. Options are global, so they apply to the
entire process, which is inconvenient for compiling multiple modules
in the same process (e.g. a JIT). And they aren't recorded into IR,
so in an LTO workflow you have to pass the option to the linker
rather than the compiler. If you expect an option is useful outside
of developing LLVM itself, you should provide some other way to
configure it.<br>
<br>
-Eli<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>