[llvm] r328379 - Fix Layering, move instrumentation transform headers into Instrumentation subdirectory

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 23 15:11:06 PDT 2018


Author: dblaikie
Date: Fri Mar 23 15:11:06 2018
New Revision: 328379

URL: http://llvm.org/viewvc/llvm-project?rev=328379&view=rev
Log:
Fix Layering, move instrumentation transform headers into Instrumentation subdirectory

Added:
    llvm/trunk/include/llvm/Transforms/Instrumentation/GCOVProfiler.h
      - copied, changed from r328367, llvm/trunk/include/llvm/Transforms/GCOVProfiler.h
    llvm/trunk/include/llvm/Transforms/Instrumentation/InstrProfiling.h
      - copied, changed from r328367, llvm/trunk/include/llvm/Transforms/InstrProfiling.h
    llvm/trunk/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
      - copied, changed from r328367, llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h
Removed:
    llvm/trunk/include/llvm/Transforms/GCOVProfiler.h
    llvm/trunk/include/llvm/Transforms/InstrProfiling.h
    llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h
Modified:
    llvm/trunk/lib/Passes/PassBuilder.cpp
    llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
    llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
    llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp
    llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    llvm/trunk/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp

Removed: llvm/trunk/include/llvm/Transforms/GCOVProfiler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/GCOVProfiler.h?rev=328378&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Transforms/GCOVProfiler.h (original)
+++ llvm/trunk/include/llvm/Transforms/GCOVProfiler.h (removed)
@@ -1,31 +0,0 @@
-//===- Transforms/GCOVProfiler.h - GCOVProfiler pass  ----------*- 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 the GCOV style profiler  pass.
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_GCOVPROFILER_H
-#define LLVM_TRANSFORMS_GCOVPROFILER_H
-
-#include "llvm/IR/PassManager.h"
-#include "llvm/Transforms/Instrumentation.h"
-
-namespace llvm {
-/// The gcov-style instrumentation pass
-class GCOVProfilerPass : public PassInfoMixin<GCOVProfilerPass> {
-public:
-  GCOVProfilerPass(const GCOVOptions &Options = GCOVOptions::getDefault()) : GCOVOpts(Options) { }
-  PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
-
-private:
-  GCOVOptions GCOVOpts;
-};
-
-} // End llvm namespace
-#endif

Removed: llvm/trunk/include/llvm/Transforms/InstrProfiling.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/InstrProfiling.h?rev=328378&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Transforms/InstrProfiling.h (original)
+++ llvm/trunk/include/llvm/Transforms/InstrProfiling.h (removed)
@@ -1,125 +0,0 @@
-//===- Transforms/InstrProfiling.h - Instrumentation 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 LLVM's PGO Instrumentation lowering
-/// pass.
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_INSTRPROFILING_H
-#define LLVM_TRANSFORMS_INSTRPROFILING_H
-
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/IR/IntrinsicInst.h"
-#include "llvm/IR/PassManager.h"
-#include "llvm/ProfileData/InstrProf.h"
-#include "llvm/Transforms/Instrumentation.h"
-#include <cstddef>
-#include <cstdint>
-#include <cstring>
-#include <vector>
-
-namespace llvm {
-
-class TargetLibraryInfo;
-using LoadStorePair = std::pair<Instruction *, Instruction *>;
-
-/// Instrumentation based profiling lowering pass. This pass lowers
-/// the profile instrumented code generated by FE or the IR based
-/// instrumentation pass.
-class InstrProfiling : public PassInfoMixin<InstrProfiling> {
-public:
-  InstrProfiling() = default;
-  InstrProfiling(const InstrProfOptions &Options) : Options(Options) {}
-
-  PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
-  bool run(Module &M, const TargetLibraryInfo &TLI);
-
-private:
-  InstrProfOptions Options;
-  Module *M;
-  Triple TT;
-  const TargetLibraryInfo *TLI;
-  struct PerFunctionProfileData {
-    uint32_t NumValueSites[IPVK_Last + 1];
-    GlobalVariable *RegionCounters = nullptr;
-    GlobalVariable *DataVar = nullptr;
-
-    PerFunctionProfileData() {
-      memset(NumValueSites, 0, sizeof(uint32_t) * (IPVK_Last + 1));
-    }
-  };
-  DenseMap<GlobalVariable *, PerFunctionProfileData> ProfileDataMap;
-  std::vector<GlobalValue *> UsedVars;
-  std::vector<GlobalVariable *> ReferencedNames;
-  GlobalVariable *NamesVar;
-  size_t NamesSize;
-
-  // vector of counter load/store pairs to be register promoted.
-  std::vector<LoadStorePair> PromotionCandidates;
-
-  // The start value of precise value profile range for memory intrinsic sizes.
-  int64_t MemOPSizeRangeStart;
-  // The end value of precise value profile range for memory intrinsic sizes.
-  int64_t MemOPSizeRangeLast;
-
-  int64_t TotalCountersPromoted = 0;
-
-  /// Lower instrumentation intrinsics in the function. Returns true if there
-  /// any lowering.
-  bool lowerIntrinsics(Function *F);
-
-  /// Register-promote counter loads and stores in loops.
-  void promoteCounterLoadStores(Function *F);
-
-  /// Returns true if profile counter update register promotion is enabled.
-  bool isCounterPromotionEnabled() const;
-
-  /// Count the number of instrumented value sites for the function.
-  void computeNumValueSiteCounts(InstrProfValueProfileInst *Ins);
-
-  /// Replace instrprof_value_profile with a call to runtime library.
-  void lowerValueProfileInst(InstrProfValueProfileInst *Ins);
-
-  /// Replace instrprof_increment with an increment of the appropriate value.
-  void lowerIncrement(InstrProfIncrementInst *Inc);
-
-  /// Force emitting of name vars for unused functions.
-  void lowerCoverageData(GlobalVariable *CoverageNamesVar);
-
-  /// Get the region counters for an increment, creating them if necessary.
-  ///
-  /// If the counter array doesn't yet exist, the profile data variables
-  /// referring to them will also be created.
-  GlobalVariable *getOrCreateRegionCounters(InstrProfIncrementInst *Inc);
-
-  /// Emit the section with compressed function names.
-  void emitNameData();
-
-  /// Emit value nodes section for value profiling.
-  void emitVNodes();
-
-  /// Emit runtime registration functions for each profile data variable.
-  void emitRegistration();
-
-  /// Emit the necessary plumbing to pull in the runtime initialization.
-  /// Returns true if a change was made.
-  bool emitRuntimeHook();
-
-  /// Add uses of our data variables and runtime hook.
-  void emitUses();
-
-  /// Create a static initializer for our data, on platforms that need it,
-  /// and for any profile output file that was specified.
-  void emitInitialization();
-};
-
-} // end namespace llvm
-
-#endif // LLVM_TRANSFORMS_INSTRPROFILING_H

Copied: llvm/trunk/include/llvm/Transforms/Instrumentation/GCOVProfiler.h (from r328367, llvm/trunk/include/llvm/Transforms/GCOVProfiler.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Instrumentation/GCOVProfiler.h?p2=llvm/trunk/include/llvm/Transforms/Instrumentation/GCOVProfiler.h&p1=llvm/trunk/include/llvm/Transforms/GCOVProfiler.h&r1=328367&r2=328379&rev=328379&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/GCOVProfiler.h (original)
+++ llvm/trunk/include/llvm/Transforms/Instrumentation/GCOVProfiler.h Fri Mar 23 15:11:06 2018
@@ -1,4 +1,4 @@
-//===- Transforms/GCOVProfiler.h - GCOVProfiler pass  ----------*- C++ -*-===//
+//===- Transforms/Instrumentation/GCOVProfiler.h ----------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //

Copied: llvm/trunk/include/llvm/Transforms/Instrumentation/InstrProfiling.h (from r328367, llvm/trunk/include/llvm/Transforms/InstrProfiling.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Instrumentation/InstrProfiling.h?p2=llvm/trunk/include/llvm/Transforms/Instrumentation/InstrProfiling.h&p1=llvm/trunk/include/llvm/Transforms/InstrProfiling.h&r1=328367&r2=328379&rev=328379&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/InstrProfiling.h (original)
+++ llvm/trunk/include/llvm/Transforms/Instrumentation/InstrProfiling.h Fri Mar 23 15:11:06 2018
@@ -1,4 +1,4 @@
-//===- Transforms/InstrProfiling.h - Instrumentation passes -----*- C++ -*-===//
+//===- Transforms/Instrumentation/InstrProfiling.h --------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //

Copied: llvm/trunk/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h (from r328367, llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h?p2=llvm/trunk/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h&p1=llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h&r1=328367&r2=328379&rev=328379&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h (original)
+++ llvm/trunk/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h Fri Mar 23 15:11:06 2018
@@ -1,4 +1,4 @@
-//===- Transforms/PGOInstrumentation.h - PGO gen/use passes -----*- C++ -*-===//
+//===- Transforms/Instrumentation/PGOInstrumentation.h ----------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //

Removed: llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h?rev=328378&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h (original)
+++ llvm/trunk/include/llvm/Transforms/PGOInstrumentation.h (removed)
@@ -1,75 +0,0 @@
-//===- 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 <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:
-  PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
-};
-
-/// The profile annotation (profile-instr-use) pass for IR based PGO.
-class PGOInstrumentationUse : public PassInfoMixin<PGOInstrumentationUse> {
-public:
-  PGOInstrumentationUse(std::string Filename = "");
-
-  PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
-
-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;
-};
-
-/// The profile size based optimization pass for memory intrinsics.
-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);
-
-} // end namespace llvm
-
-#endif // LLVM_TRANSFORMS_PGOINSTRUMENTATION_H

Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=328379&r1=328378&r2=328379&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Fri Mar 23 15:11:06 2018
@@ -60,7 +60,7 @@
 #include "llvm/Support/Regex.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h"
-#include "llvm/Transforms/GCOVProfiler.h"
+#include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
 #include "llvm/Transforms/IPO/AlwaysInliner.h"
 #include "llvm/Transforms/IPO/ArgumentPromotion.h"
 #include "llvm/Transforms/IPO/CalledValuePropagation.h"
@@ -85,9 +85,9 @@
 #include "llvm/Transforms/IPO/SyntheticCountsPropagation.h"
 #include "llvm/Transforms/IPO/WholeProgramDevirt.h"
 #include "llvm/Transforms/InstCombine/InstCombine.h"
-#include "llvm/Transforms/InstrProfiling.h"
+#include "llvm/Transforms/Instrumentation/InstrProfiling.h"
 #include "llvm/Transforms/Instrumentation/BoundsChecking.h"
-#include "llvm/Transforms/PGOInstrumentation.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Scalar/ADCE.h"
 #include "llvm/Transforms/Scalar/AlignmentFromAssumptions.h"
 #include "llvm/Transforms/Scalar/BDCE.h"

Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=328379&r1=328378&r2=328379&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Fri Mar 23 15:11:06 2018
@@ -35,7 +35,7 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/Transforms/GCOVProfiler.h"
+#include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "llvm/Transforms/Utils/ModuleUtils.h"
 #include <algorithm>

Modified: llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp?rev=328379&r1=328378&r2=328379&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp Fri Mar 23 15:11:06 2018
@@ -45,7 +45,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Instrumentation.h"
-#include "llvm/Transforms/PGOInstrumentation.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/CallPromotionUtils.h"
 #include <cassert>

Modified: llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp?rev=328379&r1=328378&r2=328379&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp Fri Mar 23 15:11:06 2018
@@ -13,7 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Transforms/InstrProfiling.h"
+#include "llvm/Transforms/Instrumentation/InstrProfiling.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"

Modified: llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp?rev=328379&r1=328378&r2=328379&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp Fri Mar 23 15:11:06 2018
@@ -48,7 +48,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Transforms/PGOInstrumentation.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "CFGMST.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"

Modified: llvm/trunk/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp?rev=328379&r1=328378&r2=328379&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp Fri Mar 23 15:11:06 2018
@@ -44,7 +44,7 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Transforms/Instrumentation.h"
-#include "llvm/Transforms/PGOInstrumentation.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include <cassert>
 #include <cstdint>




More information about the llvm-commits mailing list