mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
70e2697ba1
Summary: SamplePGO uses branch_weight annotation to represent callsite hotness. When ICP promotes an indirect call to direct call, we need to make sure the direct call is annotated with branch_weight in SamplePGO mode, so that downstream function inliner can use hot callsite heuristic. Reviewers: davidxl, eraman, xur Reviewed By: davidxl, xur Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30282 llvm-svn: 296028
52 lines
1.6 KiB
C++
52 lines
1.6 KiB
C++
//===- Transforms/PGOInstrumentation.h - PGO gen/use passes ---*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
/// \file
|
|
/// This file provides the interface for IR based instrumentation passes (
|
|
/// (profile-gen, and profile-use).
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_PGOINSTRUMENTATION_H
|
|
#define LLVM_TRANSFORMS_PGOINSTRUMENTATION_H
|
|
|
|
#include "llvm/IR/PassManager.h"
|
|
#include "llvm/Transforms/Instrumentation.h"
|
|
|
|
namespace llvm {
|
|
|
|
/// The instrumentation (profile-instr-gen) pass for IR based PGO.
|
|
class PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
|
|
public:
|
|
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
|
|
};
|
|
|
|
/// The profile annotation (profile-instr-use) pass for IR based PGO.
|
|
class PGOInstrumentationUse : public PassInfoMixin<PGOInstrumentationUse> {
|
|
public:
|
|
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
|
|
PGOInstrumentationUse(std::string Filename = "");
|
|
|
|
private:
|
|
std::string ProfileFileName;
|
|
};
|
|
|
|
/// The indirect function call promotion pass.
|
|
class PGOIndirectCallPromotion : public PassInfoMixin<PGOIndirectCallPromotion> {
|
|
public:
|
|
PGOIndirectCallPromotion(bool IsInLTO = false, bool SamplePGO = false)
|
|
: InLTO(IsInLTO), SamplePGO(SamplePGO) {}
|
|
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
|
|
|
|
private:
|
|
bool InLTO;
|
|
bool SamplePGO;
|
|
};
|
|
|
|
} // End llvm namespace
|
|
#endif
|