<br><br><div class="gmail_quote">2009/7/10 Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com">nlewycky@google.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote">2009/7/10 Dan Gohman <span dir="ltr"><<a href="mailto:gohman@apple.com" target="_blank">gohman@apple.com</a>></span><div class="im"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: djg<br>
Date: Fri Jul 10 11:42:52 2009<br>
New Revision: 75252<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=75252&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=75252&view=rev</a><br>
Log:<br>
Generalize ScalarEvolution's cast-folding code to support more kinds<br>
of loops. Add several new functions to for working with ScalarEvolution's<br>
add-hoc value-range analysis functionality.</blockquote><div><br></div></div><div>Dan, this looks great! Does this kill off LoopVR?</div><div><br></div><div>Why does isKnownPositive(Step) control whether the range should be considered signed or unsigned? You're already considering it 'signed' just by asking the question; an unsigned value is always positive :-)</div>
<div><br></div><div>The intuition here is that getSignedRange and getUnsignedRange could be merged by checking for the SLT, SGT and ULE cases all in one implementation which in turn leads to collapsing of cases in a lot of code. (Oh, and the SCEVUnknown code could do both types of computation and just take the smaller of the two resulting ranges.)</div>
</div></blockquote><div><br></div><div>I realized a few minutes after I sent this that it won't collapse too much code because ConstantRange::getSignedMin and ConstantRange::getUnsignedMax will return different values sometimes. So trying to merge getSignedRange and getUnsignedRange may not be worth pursuing, especially if the code is working correctly as-is. :-)</div>
<div><br></div><div>Nick</div><div><br></div></div>