[PATCH] [IC] Turn non-null MD on pointer loads to range MD on integer loads.

Philip Reames listmail at philipreames.com
Mon Feb 23 11:34:07 PST 2015


================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:343
@@ +342,3 @@
+        auto *ITy = dyn_cast<IntegerType>(NewTy);
+        if (!ITy) break;
+        Metadata *Range[] = {
----------------
cdavis5x wrote:
> reames wrote:
> > Meta comment: This does assume that null is integer value 0.  I think that's in practice a safe assumption.  
> You know, the possibility of `null != 0` crossed my mind, but I dismissed it because like you said, in practice, on every platform we support, `null == 0`. In fact, the only example I can think of off the top of my head is segmented-memory-model x86, where `null` would be a 0 segment and an `undef` offset (i.e. doesn't matter)--and I get the feeling that nobody around here wants to support //that//. ;)
> 
> Do you want me to add a `FIXME` or some other comment here noting this?
No comment needed.  This is a pretty wide spread issue.

http://reviews.llvm.org/D7621

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list