[PATCH] Add support for nonnull metadata on Loads

Philip Reames listmail at philipreames.com
Fri Sep 5 14:42:25 PDT 2014


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5220.13345.patch
Type: text/x-patch
Size: 1603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140905/ff91f4d1/attachment.bin>


More information about the llvm-commits mailing list