[PATCH] Fix GlobalOpt to use range metadata instead of creating SelectInsts.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Mar 17 08:23:28 PDT 2014


LGTM

On 16 March 2014 14:07, Dan Gohman <dan433584 at gmail.com> wrote:
> On Wed, Mar 12, 2014 at 9:56 AM, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>>
>>
>> > This patch is still powerful enough to optimize the bzip2 benchmark that
>> > originally motivated this optimization. It's only less powerful in that
>> > it
>> > indicates a range of values instead of just the two discrete values, but
>> > it
>> > seems most existing optimizations just care about the range. If more
>> > precise
>> > information is desired, it would make sense to augment the range
>> > metadata to
>> > be able to provide that. If that is done, then this optimization could
>> > easily be augmented to support it.
>>
>> The range should already support that if need. Only the optimization
>> would need to up updated to created multiple ranges.
>
>
> I missed that earlier. Attached is a new patch which implements this, and
> uses APInts as you suggested.
>
>>
>> One more nit, can you update test/Transforms/GlobalOpt/integer-bool.ll
>> to also CHECK the range added to the load?
>
>
> The load in that testcase is eliminated, so I added a new test in which
> loads aren't eliminated, that tests that they have the range metadata.
>
> Dan
>




More information about the llvm-commits mailing list