[PATCH] Add support for nonnull metadata on Loads

Philip Reames listmail at philipreames.com
Mon Sep 8 13:28:43 PDT 2014


On 09/08/2014 01:23 PM, Hal Finkel wrote:
> ----- Original Message -----
>> From: "Nick Lewycky" <nlewycky at google.com>
>> To: reviews+D5220+public+15c0a768ddf63cc0 at reviews.llvm.org
>> Cc: "Philip Reames" <listmail at philipreames.com>, "Hal Finkel" <hfinkel at anl.gov>, "Commit Messages and Patches for
>> LLVM" <llvm-commits at cs.uiuc.edu>
>> Sent: Monday, September 8, 2014 3:20:32 PM
>> Subject: Re: [PATCH] Add support for nonnull metadata on Loads
>>
>>
>> It would be an entirely new thing, but I would rather this be a
>> non-metadata attribute on loads, and support nonnull as well as
>> dereferenceable(n) and possibly other pointer attributes in the
>> future.
>>
> This also makes sense; I'd very much like to see dereferenceable(n) too.
For the record, me too.  :)

More generally, I'd like to be able to have first class attributes on 
most Values.  Metadata sorta serves this purpose now, but the 
distinction between "attribute" and "metadata" is unclear at best.

It would be a fair amount more work though.  I'd rather work in small 
pieces.
>
>   -Hal
>
>>
>>
>> On 5 September 2014 14:42, Philip Reames < listmail at philipreames.com
>>> wrote:
>>
>> Hi hfinkel,
>>
>> This patch simply adds support for marking a load as returning a
>> non-null pointer. This is analogous to the existing nonnull return
>> attribute, but it applies to specific load instructions instead. The
>> value of the load is allowed to vary between successive loads, but
>> null is not a valid value to be loaded by any load marked nonnull.
>>
>> Hal - I'd particularly like your input here. Is adding a parallel
>> metadata construct to the existing attribute a reasonable idea?
>> Should we be uniform and accept the metadata on calls too? Is there
>> a better way to approach this.
>>
>> http://reviews.llvm.org/D5220
>>
>> Files:
>> lib/Analysis/ValueTracking.cpp
>> test/Transforms/InstSimplify/compare.ll
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>>




More information about the llvm-commits mailing list