OSDN Git Service

[InstCombine] Transform !range metadata to !nonnull when combining loads
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 11 Oct 2016 01:00:45 +0000 (01:00 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 11 Oct 2016 01:00:45 +0000 (01:00 +0000)
commit365654256b1411c0fcaeac498267e33bb9d17d7d
tree6b7c356f185b9affd3c232d14168b0fb6ec736cb
parent7d96c0b8ac965418f4afebbbf458262eb8e13708
[InstCombine] Transform !range metadata to !nonnull when combining loads

When combining an integer load with !range metadata that does not include 0 to a pointer load, make sure emit !nonnull metadata on the newly-created pointer load. This prevents the !nonnull metadata from being dropped during a ptrtoint/inttoptr pair.

This fixes PR30597.

Patch by Ariel Ben-Yehuda!

Differential Revision: https://reviews.llvm.org/D25215

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283836 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/PR30597.ll [new file with mode: 0644]