<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Paul,<div><br></div><div>Thanks for sharing your patches.</div><div><br></div><div>This is interesting.</div><div><br></div><div>Cheers,</div><div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
<br><div><div>On Jul 29, 2013, at 2:40 PM, Redmond, Paul <<a href="mailto:paul.redmond@intel.com">paul.redmond@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi,<br><br>Several weeks ago a prototyped a feature similar to what you're describing. I was experimenting to see how one might implement a feature like ICC's -vec–report feature in clang/llvm. My approach was to create an ImmutablePass which stores notes. I modified the loop vectorizer and the unroll pass to add notes when loops were vectorized or unrolled.<br><br>On the clang side I add an OptReport to the pass manager and dump out the notes as diagnostics. It worked ok as a prototype but getting the source locations correct was a bit fragile.<br><br>I've attached some patches in case you're interested.<br><br>Paul<br><br><br><br>From: Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a><<a href="mailto:qcolombet@apple.com">mailto:qcolombet@apple.com</a>>><br>Date: Tuesday, 16 July, 2013 8:21 PM<br>To: LLVM Developers Mailing List <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><<a href="mailto:llvmdev@cs.uiuc.edu">mailto:llvmdev@cs.uiuc.edu</a>>><br>Subject: [LLVMdev] [RFC] Add warning capabilities in LLVM.<br><br>Hi,<br><br>I would like to start a discussion about error/warning reporting in LLVM and how we can extend the current mechanism to take advantage of clang capabilities.<br><br><br>** Motivation **<br><br>Currently LLVM provides a way to report error either directly (print to stderr) or by using a user defined error handler. For instance, in inline asm parsing, we can specify the diagnostic handler to report the errors in clang.<br><br>The basic idea would be to be able to do that for warnings too (and for other kind of errors?).<br>A motivating example can be found with the following link where we want LLVM to be able to warn on the stack size to help developing kernels:<br><a href="http://llvm.org/bugs/show_bug.cgi?id=4072">http://llvm.org/bugs/show_bug.cgi?id=4072</a><br><br>By adding this capability, we would be able to have access to all the nice features clang provides with warnings:<br>- Promote it to an error.<br>- Ignore it.<br><br><br>** Challenge **<br><br>To be able to take advantage of clang framework for warning/error reporting, warnings have to be associated with warning groups.<br>Thus, we need a way for the backend to specify a front-end warning type.<br><br>The challenge is, AFAICT (which is not much, I admit), that front-end warning types are statically handled using tablegen representation.<br><br><br>** Advices Needed **<br><br>1. Decide whether or not we want such capabilities (if we do not we may just add sporadically the support for a new warning/group of warning/error).<br>2. Come up with a plan to implement that (assuming we want it).<br><br><br>Thanks for the feedbacks.<br><br>Cheers,<br><br>-Quentin<br><br><span><opt_report_clang.diff></span><span><opt_report_llvm.diff></span></div></blockquote></div><br></div></body></html>