================
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Transforms/Instrumentation/MarkColdFunctions.h"
+#include "llvm/Analysis/BlockFrequencyInfo.h"
+#include "llvm/Analysis/ProfileSummaryInfo.h"
+#include "llvm/IR/PassManager.h"
+
+using namespace llvm;
+
+PreservedAnalyses MarkColdFunctionsPass::run(Module &M,
----------------
aeubanks wrote:

Having a global option determine how to handle `cold` makes the IR more 
complicated. Reusing something that already exists and is being used is nicer.

Another alternative is to rely on the profile loaders to mark functions as 
`cold`, then this pass only looks at functions marked `cold`. WDYT?

It looks like iFDO marks cold functions as `cold`, but sample FDO doesn't. If 
sample FDO is inaccurate then marking functions as `cold` may be bad, so I 
assume that's why we don't mark functions as `cold` for sample FDO. But there's 
also the "accurate" flag that says that the sample profile is accurate and 
functions not in the profile are actually cold. In that case we should mark 
functions as `cold`?

https://github.com/llvm/llvm-project/pull/69030
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to