[IC] Turn non-null MD on pointer loads to range MD on integer loads.
authorCharles Davis <cdavis5x@gmail.com>
Wed, 25 Feb 2015 05:10:25 +0000 (05:10 +0000)
committerCharles Davis <cdavis5x@gmail.com>
Wed, 25 Feb 2015 05:10:25 +0000 (05:10 +0000)
commit33d1dc000806708d65597da6a810bb450664f11d
treec0364e7539f6502c53b407f6cfb9eb1eee325010
parentd70bb8d8cbe78dceb6d3ac501244874d8f1b85af
[IC] Turn non-null MD on pointer loads to range MD on integer loads.

Summary:
This change fixes the FIXME that you recently added when you committed
(a modified version of) my patch.  When `InstCombine` combines a load and
store of an pointer to those of an equivalently-sized integer, it currently
drops any `!nonnull` metadata that might be present.  This change replaces
`!nonnull` metadata with `!range !{ 1, -1 }` metadata instead.

Reviewers: chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7621

llvm-svn: 230462
llvm/include/llvm/IR/MDBuilder.h
llvm/lib/IR/MDBuilder.cpp
llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
llvm/test/Transforms/InstCombine/loadstore-metadata.ll