43
43
#include " llvm/Transforms/Instrumentation.h"
44
44
#include " llvm/Transforms/Instrumentation/AddressSanitizer.h"
45
45
#include " llvm/Support/TimeProfiler.h"
46
+ #if LLVM_VERSION_GE(19, 0)
47
+ #include " llvm/Support/PGOOptions.h"
48
+ #endif
46
49
#include " llvm/Transforms/Instrumentation/GCOVProfiler.h"
47
50
#include " llvm/Transforms/Instrumentation/InstrProfiling.h"
48
51
#include " llvm/Transforms/Instrumentation/ThreadSanitizer.h"
@@ -749,6 +752,9 @@ LLVMRustOptimize(
749
752
FS,
750
753
#endif
751
754
PGOOptions::IRInstr, PGOOptions::NoCSAction,
755
+ #if LLVM_VERSION_GE(19, 0)
756
+ PGOOptions::ColdFuncOpt::Default,
757
+ #endif
752
758
DebugInfoForProfiling);
753
759
} else if (PGOUsePath) {
754
760
assert (!PGOSampleUsePath);
@@ -758,6 +764,9 @@ LLVMRustOptimize(
758
764
FS,
759
765
#endif
760
766
PGOOptions::IRUse, PGOOptions::NoCSAction,
767
+ #if LLVM_VERSION_GE(19, 0)
768
+ PGOOptions::ColdFuncOpt::Default,
769
+ #endif
761
770
DebugInfoForProfiling);
762
771
} else if (PGOSampleUsePath) {
763
772
PGOOpt = PGOOptions (PGOSampleUsePath, " " , " " ,
@@ -766,6 +775,9 @@ LLVMRustOptimize(
766
775
FS,
767
776
#endif
768
777
PGOOptions::SampleUse, PGOOptions::NoCSAction,
778
+ #if LLVM_VERSION_GE(19, 0)
779
+ PGOOptions::ColdFuncOpt::Default,
780
+ #endif
769
781
DebugInfoForProfiling);
770
782
} else if (DebugInfoForProfiling) {
771
783
PGOOpt = PGOOptions (" " , " " , " " ,
@@ -774,6 +786,9 @@ LLVMRustOptimize(
774
786
FS,
775
787
#endif
776
788
PGOOptions::NoAction, PGOOptions::NoCSAction,
789
+ #if LLVM_VERSION_GE(19, 0)
790
+ PGOOptions::ColdFuncOpt::Default,
791
+ #endif
777
792
DebugInfoForProfiling);
778
793
}
779
794
0 commit comments