<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        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]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Yes, FPMathOperator isn’t part of the class hierarchy.  I would interpret “increasing the size of FPMathOperator” as shorthand for increasing the size of ContstantExpr and the relevant subclasses of Instruction.  (Exactly which subclasses
 of Instruction gets a little sticky because most floating-point operations are represented by BinaryOperator, which is also used for integer arithmetic, but it’s probably solvable somehow.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-Eli<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> <b>On Behalf Of
</b>Sanjay Patel via llvm-dev<br>
<b>Sent:</b> Monday, March 18, 2019 5:16 PM<br>
<b>To:</b> Sanjoy Das <sanjoy@playingwithpointers.com><br>
<b>Cc:</b> llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Subject:</b> [EXT] Re: [llvm-dev] [RFC] Making space for a flush-to-zero flag in FastMathFlags<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">I don't have any objections to increasing the size of FPMathOperator, but I also don't know what perf impact that would have.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I made this comment in D39304:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">"I don't think we can just add a field to FPMathOperator because Operator is not intended to be instantiated."<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">That could just be me not understanding the class hierarchy?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">On Mon, Mar 18, 2019 at 11:56 AM Sanjoy Das <<a href="mailto:sanjoy@playingwithpointers.com">sanjoy@playingwithpointers.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">On Mon, Mar 18, 2019 at 9:31 AM Sanjay Patel <<a href="mailto:spatel@rotateright.com" target="_blank">spatel@rotateright.com</a>> wrote:<br>
><br>
> We knew the day when we needed another FMF bit was coming back in:<br>
> <a href="https://reviews.llvm.org/D39304" target="_blank">https://reviews.llvm.org/D39304</a><br>
> ...it was just a question of 'when'. :)<br>
><br>
> I'm guessing that an FTZ bit won't be the last new bit needed if we consider permutations between strict FP and fast-math. Even without that, denormals-as-zero (DAZ) might also be useful?<br>
> So rather than continuing to carve these out bit-by-bit, it's worth considering a more general solution: instruction-level metadata.<br>
><br>
> IIUC, the main argument for making FMF part of the instruction was that per-instruction metadata gets expensive if we're applying it to a significant chunk of the instructions.<br>
> But let's think about that - even the most FP-heavy code tops out around 10% FP math ops out of the total instruction count. Typical FP benchmark code is only 2-5% FP ops. The rest is the same load/store/control-flow/ALU stuff found in integer code.<br>
<br>
If this is true, what do you think about option (1)?  It might be<br>
simpler to increase the size of FPMathOperator by a word, giving us 64<br>
more bits of fastmath flags.  We could also have this extra word in<br>
only those instances of FPMathOperator that have a non-zero<br>
FastMathFlags (this would force us to remove setFastMathFlags since<br>
we'd need to know the contents of FastMathFlags at Instruction<br>
construction time).<br>
<br>
-- Sanjoy<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>