<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></span>
Matt Simpson and I briefly discussed this transformation.  One of his suggestions was to add a pass in the pipeline where the dominator tree was available (note my patch used a poor man's version of domination) and to add range meta-data to values (or replace values if we know the exact value) based on dominating conditions.  </blockquote><div><br></div><div>This is a pretty trivial variant of what the predicateinfo utility  does :)</div><div> </div><div>(it just happens to process branches, assumes, etc. But you could trivially modify it to change the name anywhere the range is different, to ensure the invariant that anything with the same ssa name has the same range)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I thought it was pretty interesting idea, but I'm not very familiar with how range metadata is generated and used.<div class="HOEnZb"><div class="h5"><span style="color:rgb(34,34,34)"></span></div></div></blockquote><div>GCC pretty much does what i said above:</div><div>It generates assert_expr's, which rename values, where the ranges change (this is equivalent to what predicateinfo does), then solves a lattice over the resulting IR.</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"><span style="color:rgb(34,34,34)"> </span><br></div></div></blockquote></div></div></div>