<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:0in;
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;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{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: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 style="margin-left:.5in"><a name="_MailEndCompose">Leave the test case in and switch the expectation (& perhaps add a comment explaining why this the right choice and the previous one wasn't) so there's breadcrumbs if anyone else gets the same idea again
in the future?<o:p></o:p></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hmmmm the conditions where the test failed were pretty obscure and we used a sledgehammer to drive a finishing nail. But I could see a way to make the test
prove that if an optnone function bails out of fast-isel, the DAG combiner does run, which would be the point you're driving at. It'd get a false failure if fast-isel got smarter but with the right commentary that ought to be okay. Will work on this later
today.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr<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>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<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""> David Blaikie [mailto:dblaikie@gmail.com]
<br>
<b>Sent:</b> Tuesday, March 24, 2015 7:13 PM<br>
<b>To:</b> Robinson, Paul<br>
<b>Cc:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [llvm] r233153 - 'optnone' should not disable DAG combiner.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><br>
On Mar 24, 2015 5:18 PM, "Paul Robinson" <<a href="mailto:paul_robinson@playstation.sony.com">paul_robinson@playstation.sony.com</a>> wrote:<br>
><br>
> Author: probinson<br>
> Date: Tue Mar 24 19:10:24 2015<br>
> New Revision: 233153<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=233153&view=rev">http://llvm.org/viewvc/llvm-project?rev=233153&view=rev</a><br>
> Log:<br>
> 'optnone' should not disable DAG combiner.<br>
><br>
> Reverts the code change from r221168 and the relevant test.<br>
> It was a mistake to disable the combiner, and based on the ultimate<br>
> definition of 'optnone' we shouldn't have considered the test case<br>
> as failing in the first place.<o:p></o:p></p>
<p>Leave the test case in and switch the expectation (& perhaps add a comment explaining why this the right choice and the previous one wasn't) so there's breadcrumbs if anyone else gets the same idea again in the future?<o:p></o:p></p>
<p>><br>
> Removed:<br>
> llvm/trunk/test/CodeGen/X86/fastmath-optnone.ll<br>
> Modified:<br>
> llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>
><br>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=233153&r1=233152&r2=233153&view=diff">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=233153&r1=233152&r2=233153&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)<br>
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Mar 24 19:10:24 2015<br>
> @@ -1183,11 +1183,6 @@ void DAGCombiner::Run(CombineLevel AtLev<br>
> LegalOperations = Level >= AfterLegalizeVectorOps;<br>
> LegalTypes = Level >= AfterLegalizeTypes;<br>
><br>
> - // Early exit if this basic block is in an optnone function.<br>
> - if (DAG.getMachineFunction().getFunction()->hasFnAttribute(<br>
> - Attribute::OptimizeNone))<br>
> - return;<br>
> -<br>
> // Add all the dag nodes to the worklist.<br>
> for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),<br>
> E = DAG.allnodes_end(); I != E; ++I)<br>
><br>
> Removed: llvm/trunk/test/CodeGen/X86/fastmath-optnone.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastmath-optnone.ll?rev=233152&view=auto">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fastmath-optnone.ll?rev=233152&view=auto</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/fastmath-optnone.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/fastmath-optnone.ll (removed)<br>
> @@ -1,35 +0,0 @@<br>
> -; RUN: llc < %s -mcpu=corei7 -march=x86-64 -mattr=+sse2 | FileCheck %s<br>
> -; Verify that floating-point operations inside 'optnone' functions<br>
> -; are not optimized even if unsafe-fp-math is set.<br>
> -<br>
> -define float @foo(float %x) #0 {<br>
> -entry:<br>
> - %add = fadd fast float %x, %x<br>
> - %add1 = fadd fast float %add, %x<br>
> - ret float %add1<br>
> -}<br>
> -<br>
> -; CHECK-LABEL: @foo<br>
> -; CHECK-NOT: add<br>
> -; CHECK: mul<br>
> -; CHECK-NOT: add<br>
> -; CHECK: ret<br>
> -<br>
> -define float @fooWithOptnone(float %x) #1 {<br>
> -entry:<br>
> - %add = fadd fast float %x, %x<br>
> - %add1 = fadd fast float %add, %x<br>
> - ret float %add1<br>
> -}<br>
> -<br>
> -; CHECK-LABEL: @fooWithOptnone<br>
> -; CHECK-NOT: mul<br>
> -; CHECK: add<br>
> -; CHECK-NOT: mul<br>
> -; CHECK: add<br>
> -; CHECK-NOT: mul<br>
> -; CHECK: ret<br>
> -<br>
> -<br>
> -attributes #0 = { "unsafe-fp-math"="true" }<br>
> -attributes #1 = { noinline optnone "unsafe-fp-math"="true" }<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</div>
</div>
</body>
</html>