Skip to content

Commit

Permalink
[Transforms] Fix some Clang-tidy modernize and Include What You Use w…
Browse files Browse the repository at this point in the history
…arnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316253 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
EugeneZelenko committed Oct 21, 2017
1 parent 26843fd commit cd98608
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 176 deletions.
24 changes: 18 additions & 6 deletions include/llvm/Transforms/PGOInstrumentation.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
//===- Transforms/PGOInstrumentation.h - PGO gen/use passes ---*- 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/ADT/ArrayRef.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Transforms/Instrumentation.h"
#include <cstdint>
#include <string>

namespace llvm {

class Function;
class Instruction;
class Module;

/// The instrumentation (profile-instr-gen) pass for IR based PGO.
class PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
public:
Expand All @@ -28,9 +36,10 @@ class PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
/// 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 = "");

PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);

private:
std::string ProfileFileName;
};
Expand All @@ -40,6 +49,7 @@ class PGOIndirectCallPromotion : public PassInfoMixin<PGOIndirectCallPromotion>
public:
PGOIndirectCallPromotion(bool IsInLTO = false, bool SamplePGO = false)
: InLTO(IsInLTO), SamplePGO(SamplePGO) {}

PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);

private:
Expand All @@ -50,12 +60,14 @@ class PGOIndirectCallPromotion : public PassInfoMixin<PGOIndirectCallPromotion>
/// The profile size based optimization pass for memory intrinsics.
class PGOMemOPSizeOpt : public PassInfoMixin<PGOMemOPSizeOpt> {
public:
PGOMemOPSizeOpt() {}
PGOMemOPSizeOpt() = default;

PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};

void setProfMetadata(Module *M, Instruction *TI, ArrayRef<uint64_t> EdgeCounts,
uint64_t MaxCount);

} // End llvm namespace
#endif
} // end namespace llvm

#endif // LLVM_TRANSFORMS_PGOINSTRUMENTATION_H
Loading

0 comments on commit cd98608

Please sign in to comment.