<div><div dir="auto">My concern wasn't a phylosophical one but a pragmatic one. Learning about poor choices when lowering memset is probably quite useful. Having a flag that just turns off idiom recognition for it may just work around the problem. But the problem may still exist.</div><div dir="auto">In any case, I'm not fundamentally against such a flag but it just seems like something that could</div><div dir="auto">1. Hide a problem </div><div dir="auto">2. Get a bit unwieldy - today it's memset, maybe tomorrow memcpy, etc. And then does a single flag turn off all idiom recognition? A separate flag for each? Maybe groups (i.e. Memory functions). And so on. </div><br><div class="gmail_quote"><div>On Thu, Aug 17, 2017 at 7:29 PM Robinson, Paul via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-6210017620145208930WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Right, it's a balance between those snooty compiler developers who think they always know best versus those pesky real-world code authors who think they can
hand-tune their code to do better than what the compiler comes up with.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Offhand I don't know how often our licensees use the option in production, but it surely gives them a tool that lets them do their own measurements, and only
come back to us when there is something worthwhile to report.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-6210017620145208930__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></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""> cfe-dev [mailto:<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.org</a>]
<b>On Behalf Of </b>Reid Kleckner via cfe-dev<br>
<b>Sent:</b> Wednesday, August 16, 2017 1:39 PM<br>
<b>To:</b> Tim Northover<br>
<b>Cc:</b> LLVM Developers Mailing List; <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> Developers; bharathi seshadri<br>
<b>Subject:</b> Re: [cfe-dev] [llvm-dev] Disable memset synthesis<u></u><u></u></span></p>
</div>
</div></div></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-6210017620145208930WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">On Tue, Aug 15, 2017 at 9:37 PM, Tim Northover via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">On 15 August 2017 at 19:38, bharathi seshadri via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> I find that GCC has an option -fno-tree-loop-distribute-patterns that<br>
> can be used to disable memcpy/memset synthesis. I wonder if there is<br>
> something similar in llvm/clang.<br>
<br>
I have no idea what that means, but we almost certainly don't have any<br>
option with similar semantics. Clang does not provide options to<br>
control specific optimization passes like that.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I think Sony exposes an option to disable idiom recognition in PS4 compiler. This seems like one of those areas where users keep asking for something and we keep insisting that what they think they want isn't actually what they want, i.e.
disabling idiom recognition blocks mid-level canonicalization and that leads to missing optimizations and bad performance, etc. However, the user feedback has been persistent, and in the interests of not having to hear about it again, we might want to consider
giving users the rope they need to hang themselves. It would let them work around real performance problems today rather than waiting for the next version of the compiler that will lower memset/memcpy/memcmp better.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-6210017620145208930WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt"></div>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>