[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)
commitfba7e30f0f850877977dd7f91b88b836fa533469
tree49ea4a615c315a823b0dfb53f65e2ecfcf0f515f
parent465084ffcfde0e24d46a480b4d2546f9b477bf10
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230462 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/MDBuilder.h
lib/IR/MDBuilder.cpp
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/loadstore-metadata.ll