This revision was automatically updated to reflect the committed changes. Closed by commit rGf686e4bbc20a: [Remarks] Make sure -fdiagnostics-hotness-threshold implies -fdiagnostics-show… (authored by serge-sans-paille).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153746/new/ https://reviews.llvm.org/D153746 Files: clang/test/Frontend/remarks-hotness.cpp llvm/lib/IR/LLVMRemarkStreamer.cpp Index: llvm/lib/IR/LLVMRemarkStreamer.cpp =================================================================== --- llvm/lib/IR/LLVMRemarkStreamer.cpp +++ llvm/lib/IR/LLVMRemarkStreamer.cpp @@ -96,8 +96,8 @@ LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional<uint64_t> RemarksHotnessThreshold) { - if (RemarksWithHotness) - Context.setDiagnosticsHotnessRequested(true); + if (RemarksWithHotness || RemarksHotnessThreshold.value_or(1)) + Context.setDiagnosticsHotnessRequested(true); Context.setDiagnosticsHotnessThreshold(RemarksHotnessThreshold); @@ -143,7 +143,7 @@ LLVMContext &Context, raw_ostream &OS, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional<uint64_t> RemarksHotnessThreshold) { - if (RemarksWithHotness) + if (RemarksWithHotness || RemarksHotnessThreshold.value_or(1)) Context.setDiagnosticsHotnessRequested(true); Context.setDiagnosticsHotnessThreshold(RemarksHotnessThreshold); Index: clang/test/Frontend/remarks-hotness.cpp =================================================================== --- clang/test/Frontend/remarks-hotness.cpp +++ clang/test/Frontend/remarks-hotness.cpp @@ -13,6 +13,13 @@ // RUN: -fdiagnostics-hotness-threshold=auto 2>&1 \ // RUN: | FileCheck -check-prefix=HOT_CALL %s +// Make sure -fdiagnostics-hotness-threshold implies -fdiagnostics-show-hotness +// RUN: %clang_cc1 -triple x86_64-linux %s -emit-llvm-only -O3 \ +// RUN: -fprofile-sample-use=%S/Inputs/remarks-hotness.prof \ +// RUN: -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline \ +// RUN: -fdiagnostics-hotness-threshold=auto 2>&1 \ +// RUN: | FileCheck -check-prefix=HOT_CALL %s + int callee1() { return 1; }
Index: llvm/lib/IR/LLVMRemarkStreamer.cpp =================================================================== --- llvm/lib/IR/LLVMRemarkStreamer.cpp +++ llvm/lib/IR/LLVMRemarkStreamer.cpp @@ -96,8 +96,8 @@ LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional<uint64_t> RemarksHotnessThreshold) { - if (RemarksWithHotness) - Context.setDiagnosticsHotnessRequested(true); + if (RemarksWithHotness || RemarksHotnessThreshold.value_or(1)) + Context.setDiagnosticsHotnessRequested(true); Context.setDiagnosticsHotnessThreshold(RemarksHotnessThreshold); @@ -143,7 +143,7 @@ LLVMContext &Context, raw_ostream &OS, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional<uint64_t> RemarksHotnessThreshold) { - if (RemarksWithHotness) + if (RemarksWithHotness || RemarksHotnessThreshold.value_or(1)) Context.setDiagnosticsHotnessRequested(true); Context.setDiagnosticsHotnessThreshold(RemarksHotnessThreshold); Index: clang/test/Frontend/remarks-hotness.cpp =================================================================== --- clang/test/Frontend/remarks-hotness.cpp +++ clang/test/Frontend/remarks-hotness.cpp @@ -13,6 +13,13 @@ // RUN: -fdiagnostics-hotness-threshold=auto 2>&1 \ // RUN: | FileCheck -check-prefix=HOT_CALL %s +// Make sure -fdiagnostics-hotness-threshold implies -fdiagnostics-show-hotness +// RUN: %clang_cc1 -triple x86_64-linux %s -emit-llvm-only -O3 \ +// RUN: -fprofile-sample-use=%S/Inputs/remarks-hotness.prof \ +// RUN: -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline \ +// RUN: -fdiagnostics-hotness-threshold=auto 2>&1 \ +// RUN: | FileCheck -check-prefix=HOT_CALL %s + int callee1() { return 1; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits