]> granicus.if.org Git - llvm/commit
Preserve nonnull metadata on Loads through SROA & mem2reg.
authorLuqman Aden <me@luqman.ca>
Wed, 22 Mar 2017 19:16:39 +0000 (19:16 +0000)
committerLuqman Aden <me@luqman.ca>
Wed, 22 Mar 2017 19:16:39 +0000 (19:16 +0000)
commit2b66aeed20b61d42cd2782b94d5419c6faca49a1
treebd8cce9575153c91c531071e589914fbcf396c09
parente53e585ce97d707ccb82b517dc35de9bc8cf62b0
Preserve nonnull metadata on Loads through SROA & mem2reg.

Summary:
https://llvm.org/bugs/show_bug.cgi?id=31142 :

SROA was dropping the nonnull metadata on loads from allocas that got optimized out. This patch simply preserves nonnull metadata on loads through SROA and mem2reg.

Reviewers: chandlerc, efriedma

Reviewed By: efriedma

Subscribers: hfinkel, spatel, efriedma, arielb1, davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298540 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
test/Transforms/Mem2Reg/preserve-nonnull-load-metadata.ll [new file with mode: 0644]
test/Transforms/SROA/preserve-nonnull.ll [new file with mode: 0644]