about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-13 07:19:39 +0000
committerbors <bors@rust-lang.org>2024-02-13 07:19:39 +0000
commitfd9bb7fddedddc2ab48665214efae780dc64af2d (patch)
treeaefb5c40df91e97191af76d6f1aa372e60e004c4 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent09d73fab0823ecddd5e67e042cd0de3863c3d501 (diff)
parent70ea26d3499dd4463ec01b5156509ca75e010c78 (diff)
downloadrust-fd9bb7fddedddc2ab48665214efae780dc64af2d.tar.gz
rust-fd9bb7fddedddc2ab48665214efae780dc64af2d.zip
Auto merge of #121003 - matthiaskrgr:rollup-u5wyztn, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #120696 (Properly handle `async` block and `async fn` in `if` exprs without `else`)
 - #120751 (Provide more suggestions on invalid equality where bounds)
 - #120802 (Bail out of drop elaboration when encountering error types)
 - #120967 (docs: mention round-to-even in precision formatting)
 - #120973 (allow static_mut_ref in some tests that specifically test mutable statics)
 - #120974 (llvm-wrapper: adapt for LLVM API change: Add support for EXPORTAS name types)
 - #120986 (iterator.rs: remove "Basic usage" text)
 - #120987 (remove redundant logic)
 - #120988 (fix comment)
 - #120995 (PassWrapper: adapt for llvm/llvm-project@93cdd1b5cfa3735c)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 3b6bf03686b..a358a40f92b 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -43,6 +43,9 @@
 #include "llvm/Transforms/Instrumentation.h"
 #include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
 #include "llvm/Support/TimeProfiler.h"
+#if LLVM_VERSION_GE(19, 0)
+#include "llvm/Support/PGOOptions.h"
+#endif
 #include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
 #include "llvm/Transforms/Instrumentation/InstrProfiling.h"
 #include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
@@ -749,6 +752,9 @@ LLVMRustOptimize(
                         FS,
 #endif
                         PGOOptions::IRInstr, PGOOptions::NoCSAction,
+#if LLVM_VERSION_GE(19, 0)
+                        PGOOptions::ColdFuncOpt::Default,
+#endif
                         DebugInfoForProfiling);
   } else if (PGOUsePath) {
     assert(!PGOSampleUsePath);
@@ -758,6 +764,9 @@ LLVMRustOptimize(
                         FS,
 #endif
                         PGOOptions::IRUse, PGOOptions::NoCSAction,
+#if LLVM_VERSION_GE(19, 0)
+                        PGOOptions::ColdFuncOpt::Default,
+#endif
                         DebugInfoForProfiling);
   } else if (PGOSampleUsePath) {
     PGOOpt = PGOOptions(PGOSampleUsePath, "", "",
@@ -766,6 +775,9 @@ LLVMRustOptimize(
                         FS,
 #endif
                         PGOOptions::SampleUse, PGOOptions::NoCSAction,
+#if LLVM_VERSION_GE(19, 0)
+                        PGOOptions::ColdFuncOpt::Default,
+#endif
                         DebugInfoForProfiling);
   } else if (DebugInfoForProfiling) {
     PGOOpt = PGOOptions("", "", "",
@@ -774,6 +786,9 @@ LLVMRustOptimize(
                         FS,
 #endif
                         PGOOptions::NoAction, PGOOptions::NoCSAction,
+#if LLVM_VERSION_GE(19, 0)
+                        PGOOptions::ColdFuncOpt::Default,
+#endif
                         DebugInfoForProfiling);
   }