<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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
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"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi, Chandler,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The initial issue I fixed was “soft hang behavior” of SCEV on a quite big IR. I didn’t find a way to make a test/unittest that will check something like amount
 of time an input IR is processed. The test I added will “soft hang” without recursion depth limit or with a limit set to high value. Would you please advise what approach should I use to check such issues? Or if “very slow test” is a good criteria to check
 such a regression, what estimated time for test will be supposed as “not regressed”?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks in advance!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Chandler Carruth [mailto:chandlerc@gmail.com]
<br>
<b>Sent:</b> Tuesday, February 07, 2017 12:39 AM<br>
<b>To:</b> Chandler Carruth; Sanjoy Das<br>
<b>Cc:</b> Fukalov, Daniil; llvm-commits<br>
<b>Subject:</b> Re: [llvm] r294181 - [SCEV] limit recursion depth and operands number in getAddExpr<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">On Mon, Feb 6, 2017 at 11:41 AM Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal">On Mon, Feb 6, 2017 at 11:37 AM Sanjoy Das via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Let's revert for now then?  Once we figure out some other way to test<br>
this, we'll re-land.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">I'm happy with that or with blindly throttling the test. I don't know how serious the issue being fixed is.<o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Seeing no response yet and after an IRC discussion with Sanjoy, I've reduced the iterations in the test to 10 and added a FIXME to figure out how to really test what this patch is intending to test. Landed in r294241.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
On Feb 6, 2017 11:27, "Chandler Carruth via llvm-commits"<br>
<<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> On Mon, Feb 6, 2017 at 11:22 AM Chandler Carruth <<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>> wrote:<br>
>><br>
>> This adds a unittest that *with optimizations* takes over 20 seconds to run. That seems excessive.<br>
><br>
><br>
> Specifically...<br>
><br>
>><br>
>> On Mon, Feb 6, 2017 at 4:49 AM Daniil Fukalov via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>>><br>
>>> +static cl::opt<unsigned><br>
>>> +    MaxAddExprDepth("scalar-evolution-max-addexpr-depth", cl::Hidden,<br>
>>> +                    cl::desc("Maximum depth of recursive AddExpr"),<br>
>>> +                    cl::init(32));<br>
><br>
><br>
> The recursion limit is 32...<br>
><br>
><br>
>>><br>
>>> +  for (int i = 0; i < 1000; i++) {<br>
>>> +    Mul1 = BinaryOperator::CreateMul(Add2, Add1, "", EntryBB);<br>
>>> +    Add1 = Add2;<br>
>>> +    Add2 = BinaryOperator::CreateAdd(Mul1, Add1, "", EntryBB);<br>
>>> +  }<br>
><br>
><br>
> And the test builds IR with 1000 adds and 1000 muls. It isn't clear at all that this is a reasonable way to unittest something.<br>
><br>
> What's worse, when I make this 1000 be 10 instead, nothing fails despite transitioning from above to below the recursion limit above. So I'm not really sure what this is testing at all?<br>
<br>
I don't think it is supposed to fail that way.  The buggy behavior is<br>
to, with an infinite (say) recursion limit, take an exponential amount<br>
of time to construct the SCEV expression.<br>
<br>
-- Sanjoy<br>
<br>
><br>
> Anyways, this is making each of my test runs over 50% slower (18s -> 26s) and I suspect several build bots are similarly impacted.<br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>