#ifndef LLVM_TRANSFORMS_PGOINSTRUMENTATION_H
#define LLVM_TRANSFORMS_PGOINSTRUMENTATION_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/PassManager.h"
#include <cstdint>
#include <string>
namespace llvm {
class Function;
class Instruction;
class Module;
class PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
public:
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
class PGOInstrumentationUse : public PassInfoMixin<PGOInstrumentationUse> {
public:
PGOInstrumentationUse(std::string Filename = "");
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
private:
std::string ProfileFileName;
};
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;
};
class PGOMemOPSizeOpt : public PassInfoMixin<PGOMemOPSizeOpt> {
public:
PGOMemOPSizeOpt() = default;
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
void setProfMetadata(Module *M, Instruction *TI, ArrayRef<uint64_t> EdgeCounts,
uint64_t MaxCount);
void setIrrLoopHeaderMetadata(Module *M, Instruction *TI, uint64_t Count);
}
#endif