<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi Alp,</div><div><br></div><div>Thanks for the review. I incorporated some of your suggestions. Please review the patches below.</div><div><br></div><div><br></div><div><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;"><blockquote type="cite"> void<br> OptimizationRemarkHandler(const llvm::DiagnosticInfoOptimizationRemark &D);<br> void OptimizationRemarkHandler(<br> const llvm::DiagnosticInfoOptimizationRemarkMissed &D);<br> void OptimizationRemarkHandler(<br> const llvm::DiagnosticInfoOptimizationRemarkAnalysis &D);<br>+ void OptimizationWarningHandler(<br>+ const llvm::DiagnosticInfoOptimizationWarning &D);<br></blockquote><br>I don't get this. The frontend maps backend remarks to frontend diagnostics so why the special case?<br></div></blockquote><div><br></div><div>This is patch is not another remark. See LLVM commit r213110 which added the warnings to llvm. We produce a warning when an explicitly specified optimization (currently vectorization or interleaving) fails. In clang the user can explicitly specify vectorization, interleaving, and unrolling with a pragma clang loop directive.</div><div><br></div><div><br></div><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;"><blockquote type="cite"> - Diags.Report(Loc, DiagID) << AddFlagValue(D.getPassName())<br>- << D.getMsg().str();<br>+ // Flag value not used by all optimization messages.<br>+ if (D.getPassName())<br>+ Diags.Report(Loc, DiagID) << AddFlagValue(D.getPassName())<br>+ << D.getMsg().str();<br>+ else<br>+ Diags.Report(Loc, DiagID) << D.getMsg().str();<br></blockquote><br>Is this change necessary? The existing code had the same functionality without the need for an if/else here AFAICT.<br></div></blockquote><div><br></div><div>If I changed the implementation of AddFlagValue it might work. The problem is that it is a struct and its constructor expects a StringRef. This is constructed implicitly from the char* returned by getPassName(). But this could be null causing an assertion when building the StringRef.</div><div><br></div><div><br></div><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;">I think the plan was to handle this with user-defined diagnostic mappings rather than what's being done here.<br></div></blockquote><div><br></div><div>What do you mean? Can you elaborate?</div><div><br></div><div>Tyler</div><div><br></div><div>LLVM:</div><div><br></div><div></div></div></body></html>