[PATCH] Add support for nonnull metadata on Loads

Hal Finkel hfinkel at anl.gov
Mon Sep 8 13:23:11 PDT 2014


----- 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.

 -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
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list