<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 23, 2017 at 10:22 AM, David Li via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added a comment.<br>
<br>
A general comment.<br>
<br>
The range profiling should not be limited to just memory intrinsics.  It should be designed to be a more general interval profiler. Interval profiler is also useful for other value profiling transformations such as mod operation for integer values (x%y). The value profiler can do interval profiling for division x/y and track resulting values in interval [0, 1].<br></blockquote><div><br></div><div>why do we need to track the result? I think usually we profile the divisor. Current code can track the range of divisor. The only issue is that I assume the type to be unsigned.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In a more general form, an interval profiler API should specify the following things<br>
<br>
1. counter index<br>
2. interval start and end (inclusive) : [S, E]<br>
3. optionally specify the start value of a large value range [SL, inf)<br>
<br>
3 + (E-S+1)  values will be tracked:<br>
(-inf, S) one value<br>
[S,E] one for each in the range<br>
[E, SL) one value<br>
[SL, inf) for one.<br>
<br>
The client (instrumentor) decides the the interval boundaries depending on the value profile kind.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Index is obtained incrementally in the instrumentation. I don't think it's necessary to expose it to the API.</div><div>right now, there is options to control the intervals. it's universal to all range profiles.</div><div>I can have the client choose the intervals by including it into the instrumentation intrinsic. </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D28964" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D28964</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>