Index: lib/IR/Module.cpp =================================================================== --- lib/IR/Module.cpp +++ lib/IR/Module.cpp @@ -512,7 +512,7 @@ } void Module::setProfileSummary(Metadata *M) { - addModuleFlag(ModFlagBehavior::Error, "ProfileSummary", M); + addModuleFlag(ModFlagBehavior::Warning, "ProfileSummary", M); } Metadata *Module::getProfileSummary() { Index: test/Transforms/PGOProfile/PR28219.ll =================================================================== --- test/Transforms/PGOProfile/PR28219.ll +++ test/Transforms/PGOProfile/PR28219.ll @@ -6,7 +6,7 @@ entry: ret i32 1 } -; CHECK-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}} +; CHECK-DAG: {{![0-9]+}} = !{i32 2, !"ProfileSummary", {{![0-9]+}}} ; CHECK-DAG: {{![0-9]+}} = !{!"NumFunctions", i64 2} ; CHECK-DAG: {{![0-9]+}} = !{!"MaxFunctionCount", i64 3} Index: test/Transforms/PGOProfile/branch1.ll =================================================================== --- test/Transforms/PGOProfile/branch1.ll +++ test/Transforms/PGOProfile/branch1.ll @@ -44,6 +44,6 @@ %retv = phi i32 [ %add, %if.then ], [ %i, %entry ] ret i32 %retv } -; USE-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}} +; USE-DAG: {{![0-9]+}} = !{i32 2, !"ProfileSummary", {{![0-9]+}}} ; USE-DAG: {{![0-9]+}} = !{!"DetailedSummary", {{![0-9]+}}} ; USE-DAG: ![[FUNC_ENTRY_COUNT]] = !{!"function_entry_count", i64 3} Index: test/Transforms/SampleProfile/summary.ll =================================================================== --- test/Transforms/SampleProfile/summary.ll +++ test/Transforms/SampleProfile/summary.ll @@ -6,7 +6,7 @@ ret i32 1, !dbg !2 } -; CHECK-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}} +; CHECK-DAG: {{![0-9]+}} = !{i32 2, !"ProfileSummary", {{![0-9]+}}} ; CHECK-DAG: {{![0-9]+}} = !{!"NumFunctions", i64 2} ; CHECK-DAG: {{![0-9]+}} = !{!"MaxFunctionCount", i64 3}