Index: lib/Transforms/Utils/SimplifyCFG.cpp =================================================================== --- lib/Transforms/Utils/SimplifyCFG.cpp +++ lib/Transforms/Utils/SimplifyCFG.cpp @@ -1061,7 +1061,8 @@ LLVMContext::MD_tbaa, LLVMContext::MD_range, LLVMContext::MD_fpmath, - LLVMContext::MD_invariant_load + LLVMContext::MD_invariant_load, + LLVMContext::MD_nonnull }; combineMetadata(I1, I2, KnownIDs); I2->eraseFromParent(); @@ -1311,6 +1312,7 @@ if (!I2->use_empty()) I2->replaceAllUsesWith(I1); I1->intersectOptionalDataWith(I2); + // Should we be combining metadata here? I2->eraseFromParent(); if (UpdateRE1)