[llvm] [CodeGen] Preserve branch weights from PGO profile during instruction selection at -O0 (PR #161620)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 5 11:13:53 PDT 2025
================
@@ -229,6 +229,17 @@ static bool dontUseFastISelFor(const Function &Fn) {
});
}
+static bool shouldRegisterPGOPasses(const TargetMachine &TM,
+ CodeGenOptLevel OptLevel) {
+ bool RegisterPGOPasses = OptLevel != CodeGenOptLevel::None;
+ if (!RegisterPGOPasses && TM.getPGOOption()) {
+ const PGOOptions &Options = *TM.getPGOOption();
+ RegisterPGOPasses = Options.Action != PGOOptions::PGOAction::NoAction ||
+ Options.CSAction != PGOOptions::CSPGOAction::NoCSAction;
----------------
WenleiHe wrote:
We don't need BPI if PGO action was instrumentation or optimization?
https://github.com/llvm/llvm-project/pull/161620
More information about the llvm-commits
mailing list