diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -2751,7 +2751,7 @@ LLVMContext::MD_dereferenceable, LLVMContext::MD_dereferenceable_or_null, LLVMContext::MD_access_group, LLVMContext::MD_preserve_access_index, - LLVMContext::MD_nontemporal}; + LLVMContext::MD_nontemporal, LLVMContext::MD_noundef}; combineMetadata(K, J, KnownIDs, KDominatesJ); } diff --git a/llvm/test/Transforms/InstCombine/load-combine-metadata.ll b/llvm/test/Transforms/InstCombine/load-combine-metadata.ll --- a/llvm/test/Transforms/InstCombine/load-combine-metadata.ll +++ b/llvm/test/Transforms/InstCombine/load-combine-metadata.ll @@ -7,11 +7,12 @@ ; CHECK: %[[V:.*]] = load i32, ptr %0 ; CHECK-SAME: !tbaa !{{[0-9]+}} ; CHECK-SAME: !range ![[RANGE:[0-9]+]] +; CHECK-SAME: !noundef !{{[0-9]+}} ; CHECK: store i32 %[[V]], ptr %1 ; CHECK: store i32 %[[V]], ptr %2 define void @test_load_load_combine_metadata(ptr, ptr, ptr) { - %a = load i32, ptr %0, !tbaa !8, !range !0, !alias.scope !5, !noalias !6 - %b = load i32, ptr %0, !tbaa !8, !range !1 + %a = load i32, ptr %0, !tbaa !8, !range !0, !noundef !10, !alias.scope !5, !noalias !6 + %b = load i32, ptr %0, !tbaa !8, !range !1, !noundef !10 store i32 %a, ptr %1 store i32 %b, ptr %2 ret void @@ -28,3 +29,4 @@ !7 = !{ !"tbaa root" } !8 = !{ !9, !9, i64 0 } !9 = !{ !"scalar type", !7} +!10 = !{}