<div dir="ltr">Ping.<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 28, 2014 at 11:38 AM, Dan Gohman <span dir="ltr"><<a href="mailto:dan433584@gmail.com" target="_blank">dan433584@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello,<br><br></div><div>Previously, when GlobalOpt noticed that a GlobalVariable only ever has two values, it replaced the GlobalVariable with a boolean, and introduced SelectInsts to produce the desired values. The main purpose of this was to expose the value range information to subsequent optimization passes.<br>
<br>espindola on IRC suggested that range metadata could achieve the same purpose. Attached is a patch which replaces
GlobalOpt's TryToShrinkGlobalToBoolean with a TryToAddRangeMetadata. The metadata is sufficient to enable the main optimization that TryToShrinkGlobalToBoolean enabled, as can be seen in the test/Transforms/GlobalOpt/integer-bool.ll test.<span class="HOEnZb"><font color="#888888"><br>
<br>Dan<br></font></span></div><br></div>
</blockquote></div><br></div></div>