Preserve 'nonnull' when changing type of the load.
[oota-llvm.git] / lib / Transforms / InstCombine / InstCombineLoadStoreAlloca.cpp
index 95ca1a6ff7ae97b4134bac09bf1dbf97ffe834dc..c0df914cb669b6c4cc58bcb19a14d9efb17e1cd1 100644 (file)
@@ -331,6 +331,7 @@ static LoadInst *combineLoadToNewType(InstCombiner &IC, LoadInst &LI, Type *NewT
     case LLVMContext::MD_noalias:
     case LLVMContext::MD_nontemporal:
     case LLVMContext::MD_mem_parallel_loop_access:
+    case LLVMContext::MD_nonnull:
       // All of these directly apply.
       NewLoad->setMetadata(ID, N);
       break;