Skip to content

Commit 70ea26d

Browse files
authored
Rollup merge of #120995 - durin42:llvm-19-pgo-coldfuncopt, r=cuviper
PassWrapper: adapt for llvm/llvm-project@93cdd1b5cfa3735c Should be no functional change. `@rustbot` label: +llvm-main
2 parents 21d8fb2 + 9d1bd2e commit 70ea26d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
#include "llvm/Transforms/Instrumentation.h"
4444
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
4545
#include "llvm/Support/TimeProfiler.h"
46+
#if LLVM_VERSION_GE(19, 0)
47+
#include "llvm/Support/PGOOptions.h"
48+
#endif
4649
#include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
4750
#include "llvm/Transforms/Instrumentation/InstrProfiling.h"
4851
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
@@ -749,6 +752,9 @@ LLVMRustOptimize(
749752
FS,
750753
#endif
751754
PGOOptions::IRInstr, PGOOptions::NoCSAction,
755+
#if LLVM_VERSION_GE(19, 0)
756+
PGOOptions::ColdFuncOpt::Default,
757+
#endif
752758
DebugInfoForProfiling);
753759
} else if (PGOUsePath) {
754760
assert(!PGOSampleUsePath);
@@ -758,6 +764,9 @@ LLVMRustOptimize(
758764
FS,
759765
#endif
760766
PGOOptions::IRUse, PGOOptions::NoCSAction,
767+
#if LLVM_VERSION_GE(19, 0)
768+
PGOOptions::ColdFuncOpt::Default,
769+
#endif
761770
DebugInfoForProfiling);
762771
} else if (PGOSampleUsePath) {
763772
PGOOpt = PGOOptions(PGOSampleUsePath, "", "",
@@ -766,6 +775,9 @@ LLVMRustOptimize(
766775
FS,
767776
#endif
768777
PGOOptions::SampleUse, PGOOptions::NoCSAction,
778+
#if LLVM_VERSION_GE(19, 0)
779+
PGOOptions::ColdFuncOpt::Default,
780+
#endif
769781
DebugInfoForProfiling);
770782
} else if (DebugInfoForProfiling) {
771783
PGOOpt = PGOOptions("", "", "",
@@ -774,6 +786,9 @@ LLVMRustOptimize(
774786
FS,
775787
#endif
776788
PGOOptions::NoAction, PGOOptions::NoCSAction,
789+
#if LLVM_VERSION_GE(19, 0)
790+
PGOOptions::ColdFuncOpt::Default,
791+
#endif
777792
DebugInfoForProfiling);
778793
}
779794

0 commit comments

Comments
 (0)