<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 13, 2017 at 10:53 PM Xinliang David Li <<a href="mailto:davidxl@google.com">davidxl@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 13, 2017 at 10:41 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><div dir="ltr">On Thu, Jul 13, 2017 at 7:29 PM Xinliang David Li via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 13, 2017 at 4:17 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span><div dir="ltr">On Thu, Jul 13, 2017 at 2:03 PM David Li via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added a comment.<br>
<br>
Blindly downgrade the warning into remarks can be bad -- profile mismatch problems can go undetected. People may spend more time diagnosing performance regressions due to missed warnings. Worse, we may regress in compiler without noticing.<br></blockquote></span><div><br>Any other ideas?<br><br>The diagnostic handling callbacks through to Clang aren't granular enough to demote only this warning to -Wno-error</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Can this be fixed?</div></div></div></div></blockquote></span></div></div></blockquote></div></div></div></blockquote><div><br>Maybe, though I imagine to do that would mean plumbing this diagnostic as a first class/separately identified one in the callback system, which I would guess/assume we try not to do because it increases the coupling/surface area between LLVM and Clang and the optimizers and diagnostic infrastructure.<br><br>In any case, even if we could, we'd still be left in the same place of telling users basically "this diagnostic isn't high enough quality to -Werror it, you should turn it back into a warning-not-error" and at that point, we know from experience, people tend to to ignore them... <br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> (also as a warning it undermines the confidence as warnings as actionable things that Clang has helped provide users).<br></div></div></div></blockquote><div><br></div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Warnings like this are usually actionable by users or compiler developers. </div></div></div></div></blockquote><div><br></div></span><div>Warnings are really to indicate a bug in user code.</div><div><br></div><div>For example, we use some things like this to warn users when inline assembly is likely to have a bug, because that is user code that can be fixed.</div><div><br></div><div>A profile mismatch seems much less like "user code has a bug" and so doesn't seem to fit any well in the "warning" category.</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>It is not user code bug, but still be a user bug in how PGO is used. </div></div></div></div></blockquote><div><br>Is it, though? It sounds like this is expected to some degree (& sounds like internally we encourage users to -Wno-error to get around this? Which really seems to undermine confidence in Clang's warning quality) - because the intent is to apply profiles from previous versions of the program to new versions of the program, so things will mismatch, right? And there's nothing the user's really meant to do in that case - maybe if it were over some threshold.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> The warning happens also to be a useful for catch potential compiler bug.</div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>David</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>On the other hand, remarks were specifically designed to be non-bug important information from optimization passes that users may need to act on.</div></div></div>
</blockquote></div></div></div></blockquote></div></div>