<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 26, 2013 at 11:18 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank" class="cremed">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">#3 is *definitely* wrong. Please revert that part immediately.</blockquote></div><br>OK, I've investigated this more closely, and it turns out to be benign on any target but R600, so *when* it comes out doesn't really matter, but it definitely isn't right.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">When I investigated it, I found this part of the entire patch really strange. We have had for some time the questionable decision of passing TargetTransformInfo down into SimplifyCFG and using it. One might think that 'IsTargetAware' controls this decision. But it doesn't. Instead, it controls whether we pass a non-null AliasAnalysis to SimplifyCFG, despite the fact that AA is a totally target independent thing and would be reasonable in the canonicalizing form of SimplifyCFG. This interface speaks to problem #2 I mentioned in my prior email.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Now, as it happens, the only thing that uses AA in SimplifyCFG is the newly added logic such that this has the intended effect, but I don't think this mechanism makes much sense.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Making TTI not be used in the canonicalizing phase is part of the larger refactoring of the midlevel optimizer that Andy's email aluded to and that I think is really important to happen before we start adding lots of target-specific logic to passes that share logic between the phases. We need to get interfaces for those *right*. However, I think a specialized pass that is added late in the pipeline by the target continues to be a reasonable compromise to allow forward progress until that refactoring happens.</div>
</div>