<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;"><div>Hi Andy,</div><div><br></div>yes, it could be gated by the optimization level, but I wouldn’t do it for this primitive analysis passes for several reasons:<div><br></div><div>- They only provide better answers to target hooks like the cost of an immediate, instructions, etc. The overhead of calling into NoTTI or Basic is pretty much the same as i.e. into the X86TTI.</div><div>  I would’t worry about these passes at all when it comes to compile time.</div><div><br></div><div>- Consistency - all other tools include these passes unconditionally. If the JIT does something different here it might lead to unexpected results.</div><div><br></div><div>- Don’t blame the cheap analysis - shot the expensive transformation pass instead ;-) I did a quick scan of the passes that depend during codegen on TargetTransformInfo and the heaviest users are LSR and SCEV. They are already gated by the optimization level, so they shouldn’t be a problem. The other user is SelectionDAG and that is just a very simple query, where I don’t see any noteworthy overhead.</div><div><br></div><div>I don’t think we have to worry about compile time overhead if we add add the target-specific TargetTransformInfo pass by default.</div><div><br></div><div>Cheers,</div><div>Juergen</div><div><div><div><div><div><br></div><div>On Jan 22, 2014, at 9:25 AM, Kaylor, Andrew <<a href="mailto:andrew.kaylor@intel.com">andrew.kaylor@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; 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;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">Is it possible to turn those passes off based on optimization level?<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">My concern is that a lot of MCJIT users are much more concerned about compilation time than they are about optimization.  At some point MCJIT should probably provide a finer grained control over what does and does not happen.  Right now I think setting the optimization level is the closest we come to that.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">-Andy<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span></div><div><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;"><span class="Apple-converted-space"> </span>Juergen Ributzka [<a href="mailto:juergen@apple.com">mailto:juergen@apple.com</a>]<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>Tuesday, January 21, 2014 6:53 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Kaylor, Andrew<br><b>Cc:</b><span class="Apple-converted-space"> </span>LLVM Commits<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [PATCH] Add target analysis passes to the codegen pipeline for MCJIT<o:p></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">The only passes targets placed so far into “addAnalysisPasses” are the target specific TargetTransformInfo passes. They only provide more accurate answers to target hooks and cost models. Of course this might lead to different code paths taken by optimization passes that depend on it, but I don’t know what the actual overhead of that is. <o:p></o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">On Jan 21, 2014, at 4:47 PM, Kaylor, Andrew <<a href="mailto:andrew.kaylor@intel.com" style="color: purple; text-decoration: underline;">andrew.kaylor@intel.com</a>> wrote:<o:p></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><br><br><o:p></o:p></div><div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">What’s the impact of these passes on compile time?</span><o:p></o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"> </span><o:p></o:p></div></div><div><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;">From:</span></b><span class="apple-converted-space"><span style="font-size: 10pt; font-family: Tahoma, sans-serif;"> </span></span><span style="font-size: 10pt; font-family: Tahoma, sans-serif;"><a href="mailto:llvm-commits-bounces@cs.uiuc.edu" style="color: purple; text-decoration: underline;"><span style="color: purple;">llvm-commits-bounces@cs.uiuc.edu</span></a><span class="apple-converted-space"> </span>[<a href="mailto:llvm-commits-bounces@cs.uiuc.edu" style="color: purple; text-decoration: underline;"><span style="color: purple;">mailto:llvm-commits-bounces@cs.uiuc.edu</span></a>]<span class="apple-converted-space"> </span><b>On Behalf Of<span class="apple-converted-space"> </span></b>Juergen Ributzka<br><b>Sent:</b><span class="apple-converted-space"> </span>Tuesday, January 21, 2014 10:30 AM<br><b>To:</b><span class="apple-converted-space"> </span>LLVM Commits<br><b>Subject:</b><span class="apple-converted-space"> </span>[PATCH] Add target analysis passes to the codegen pipeline for MCJIT</span><o:p></o:p></div></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <o:p></o:p></div></div><div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 10pt;">Hi @ll,<br><br>for some reason we forgot to add the target specific analysis passes to the codgen pipeline of MCJIT. All other tools (llc, etc) use these passes and so should MCJIT.<br><br>This patch adds the missing passes to the codegen pipeline. It also exposes the AddAnalysisPasses method through the C API, because the optimizer passes could also benefit from it.<br><br>Cheers,<br>Juergen</span><o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 10pt;"><br><br><br></span><o:p></o:p></p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 10pt;">_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" style="color: purple; text-decoration: underline;"><span style="color: purple;">llvm-commits@cs.uiuc.edu</span></a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" style="color: purple; text-decoration: underline;"><span style="color: purple;">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</span></a></span></div></div></div></div></div></div></div></blockquote></div><br></div></div></div></body></html>