<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 30, 2013, at 2:22 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra" style="">FWIW, this all makes perfect sense from a philosophical point of view.</div><div class="gmail_extra" style=""><br></div><div class="gmail_extra" style="">If anything, I think it is absolutely critical to differentiate the very interface this exposes from the TTI interfaces. The latter should be cost functions, that are as accurate as we can make them while remaining largely "conservative" (IE, don't assume any clever brilliance is the chip or backend; what is the impact of this in both the time and space dimensions? And with a distinct emphasis on the space dimension).</div>
<div class="gmail_extra" style=""><br></div><div class="gmail_extra" style="">What you're describing is something with a very different motivation and design constraints. Separating it thoroughly API-wise is going to be important.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">On Wed, Jan 30, 2013 at 11:07 AM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank" class="cremed">atrick@apple.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2) I could move the Target-Independent "cost" metrics into InstMetrics.cpp and use that interface within NoTTI.</blockquote>
</div><br>I think this is a much better approach. It is minimally clever. It is obvious how things work.</div><div class="gmail_extra"><br></div><div class="gmail_extra" style="">It also allows NoTTI to *selectively* use the pieces of your logic when it makes sense as a baseline approximation of TTI's interface. It may not always make sense. A potentially interesting example: complex constant expressions in GEPs may have very real cost, and we may want to model this even in NoTTI, but we likely don't want to avoid canonicalizing toward a single all-constant GEP.</div>
<div class="gmail_extra" style=""><br></div><div class="gmail_extra" style=""><br></div><div class="gmail_extra" style="">Some thoughts on the specific design of this new thing:</div><div class="gmail_extra" style=""><br></div><div class="gmail_extra" style="">
I would make it another immutable analysis pass. I think that's the simplest way to express the dependencies between it and other passes, and to ensure that it gets the correct DataLayout and other information.</div><div class="gmail_extra" style="">
<br></div><div class="gmail_extra" style="">I think 'metrics' is a bad term to use in the API / pass. If it's about cost or metrics, than TTI makes too much sense. I would really like to get the fundamental idea of canonicalization into the API so that we correctly skew the design in that direction. Does "CanonicalizationModel" work? Is there some other way to phrase the types of queries that will make this more clear?</div>
<div class="gmail_extra" style=""><br></div><div class="gmail_extra" style="">I think phrasing this in terms of "target independent" is a bit of a trap -- if it looks at the data layout, it's not going to be independent... But I think I know what you're aiming for, and completely agree with the goals, I'm just searching for better words that will lead to less confusion when we discuss this in 2 years or with others. =]</div>
<div class="gmail_extra" style=""><br></div><div class="gmail_extra" style="">Anyways, cool stuff, looking forward to even better design of these APIs.</div></div>
</blockquote></div><br><div>Great. I totally agree with all that. I'll try to think of a better name and prepare a patch. The InstMetrics name is just mimicking the current CodeMetrics. Not sure what to call it yet.</div><div><br></div><div>-Andy</div></body></html>