<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;">Thanks.<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Committed revision 199430.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><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 style=""><div>On Jan 16, 2014, at 11:17 AM, Andrew Trick <<a href="mailto:atrick@apple.com">atrick@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jan 16, 2014, at 11:14 AM, Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Andy,<div><br></div><div>Thanks for the feedbacks.</div><div>Here is the updated patch that makes a special initialization for CodeGenPrepare.</div></div></blockquote><div><br></div>LGTM. Thanks.</div><div>-Andy</div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>Cheers,<br><div apple-content-edited="true">
<div style="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-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">-Quentin</div><div style="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-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"></div></div></div></div><span><codegenprepare-test.patch></span><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div apple-content-edited="true"><div style="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-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"></div>

</div>
<br><div><div>On Jan 15, 2014, at 1:43 PM, Andrew Trick <<a href="mailto:atrick@apple.com">atrick@apple.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;"><br>On Jan 15, 2014, at 12:18 PM, Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> wrote:<br><br><blockquote type="cite">Hi,<br><br>The attached patch adds the machinery into opt to enable testing passes that use target machine information.<br>Thanks for your review.<br><br>** Context **<br><br>opt is a great tool to test/play with IR to IR passes. However, opt is not able to feed a pass with target machine information (like TargetLowering) and this prevents the testing (or an easy testing) of the meaty part of some passes (e.g., codegenprepare).<span class="Apple-converted-space"> </span><br><br><br>** Proposed Solution **<br><br>When registering a pass, a pass can now specify a second construct that takes as argument a pointer to TargetMachine.<br>The PassInfo class has been updated to reflect that possibility.<br>If such a constructor exists opt will use it instead of the default constructor when instantiating the pass.<br><br>A pass can specify that it supports the second constructor by using the new INITIALIZE_PASSxxx_WITH_TM as illustrated in codegenprepare.<br><br>A subsequent patch will make use of this feature to better test codegenprepare on something I am currently working.<br></blockquote><br>I agree, we need to be able to test codegenprepare. We don’t want to expose this interface to other passes though. IR passes should go through TTI instead.<br><br>Hardcoding a check for codegenprepare within opt.cpp isn’t great either. As we discussed in person, a good compromise would be to directly call setTargetMachineCtor from CodeGenPrepare so we don’t need the INITIALIZE_PASS…WITH_TM macros.<br><br>-Andy</div></blockquote></div><br></div></blockquote></div><br></div></blockquote></div><br></div></body></html>