aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/IPO
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Transforms/IPO')
-rw-r--r--include/llvm/Transforms/IPO/AlwaysInliner.h40
-rw-r--r--include/llvm/Transforms/IPO/CrossDSOCFI.h2
-rw-r--r--include/llvm/Transforms/IPO/FunctionAttrs.h5
-rw-r--r--include/llvm/Transforms/IPO/FunctionImport.h28
-rw-r--r--include/llvm/Transforms/IPO/GlobalOpt.h2
-rw-r--r--include/llvm/Transforms/IPO/GlobalSplit.h30
-rw-r--r--include/llvm/Transforms/IPO/InferFunctionAttrs.h2
-rw-r--r--include/llvm/Transforms/IPO/Inliner.h108
-rw-r--r--include/llvm/Transforms/IPO/InlinerPass.h94
-rw-r--r--include/llvm/Transforms/IPO/Internalize.h2
-rw-r--r--include/llvm/Transforms/IPO/LowerTypeTests.h2
-rw-r--r--include/llvm/Transforms/IPO/PartialInlining.h3
-rw-r--r--include/llvm/Transforms/IPO/PassManagerBuilder.h13
-rw-r--r--include/llvm/Transforms/IPO/SCCP.h2
-rw-r--r--include/llvm/Transforms/IPO/WholeProgramDevirt.h5
15 files changed, 221 insertions, 117 deletions
diff --git a/include/llvm/Transforms/IPO/AlwaysInliner.h b/include/llvm/Transforms/IPO/AlwaysInliner.h
new file mode 100644
index 0000000000000..15c80357e4a8c
--- /dev/null
+++ b/include/llvm/Transforms/IPO/AlwaysInliner.h
@@ -0,0 +1,40 @@
+//===-- AlwaysInliner.h - Pass to inline "always_inline" functions --------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Provides passes to inlining "always_inline" functions.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
+#define LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
+
+#include "llvm/IR/PassManager.h"
+
+namespace llvm {
+
+/// Inlines functions marked as "always_inline".
+///
+/// Note that this does not inline call sites marked as always_inline and does
+/// not delete the functions even when all users are inlined. The normal
+/// inliner should be used to handle call site inlining, this pass's goal is to
+/// be the simplest possible pass to remove always_inline function definitions'
+/// uses by inlining them. The \c GlobalDCE pass can be used to remove these
+/// functions once all users are gone.
+struct AlwaysInlinerPass : PassInfoMixin<AlwaysInlinerPass> {
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
+};
+
+/// Create a legacy pass manager instance of a pass to inline and remove
+/// functions marked as "always_inline".
+Pass *createAlwaysInlinerLegacyPass(bool InsertLifetime = true);
+
+}
+
+#endif // LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
diff --git a/include/llvm/Transforms/IPO/CrossDSOCFI.h b/include/llvm/Transforms/IPO/CrossDSOCFI.h
index 409604a7f3302..0979f5b79e868 100644
--- a/include/llvm/Transforms/IPO/CrossDSOCFI.h
+++ b/include/llvm/Transforms/IPO/CrossDSOCFI.h
@@ -21,7 +21,7 @@
namespace llvm {
class CrossDSOCFIPass : public PassInfoMixin<CrossDSOCFIPass> {
public:
- PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
}
#endif // LLVM_TRANSFORMS_IPO_CROSSDSOCFI_H
diff --git a/include/llvm/Transforms/IPO/FunctionAttrs.h b/include/llvm/Transforms/IPO/FunctionAttrs.h
index c44cc43fc0f6a..ee45f35bf11b2 100644
--- a/include/llvm/Transforms/IPO/FunctionAttrs.h
+++ b/include/llvm/Transforms/IPO/FunctionAttrs.h
@@ -30,7 +30,8 @@ namespace llvm {
/// attribute. It also discovers function arguments that are not captured by
/// the function and marks them with the nocapture attribute.
struct PostOrderFunctionAttrsPass : PassInfoMixin<PostOrderFunctionAttrsPass> {
- PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM);
+ PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
+ LazyCallGraph &CG, CGSCCUpdateResult &UR);
};
/// Create a legacy pass manager instance of a pass to compute function attrs
@@ -50,7 +51,7 @@ Pass *createPostOrderFunctionAttrsLegacyPass();
class ReversePostOrderFunctionAttrsPass
: public PassInfoMixin<ReversePostOrderFunctionAttrsPass> {
public:
- PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
}
diff --git a/include/llvm/Transforms/IPO/FunctionImport.h b/include/llvm/Transforms/IPO/FunctionImport.h
index ba5db2b5c7391..d7acbe883c5d4 100644
--- a/include/llvm/Transforms/IPO/FunctionImport.h
+++ b/include/llvm/Transforms/IPO/FunctionImport.h
@@ -13,6 +13,8 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/IR/PassManager.h"
+#include "llvm/Support/Error.h"
#include <functional>
#include <map>
@@ -42,25 +44,34 @@ public:
/// The set contains an entry for every global value the module exports.
typedef std::unordered_set<GlobalValue::GUID> ExportSetTy;
+ /// A function of this type is used to load modules referenced by the index.
+ typedef std::function<Expected<std::unique_ptr<Module>>(StringRef Identifier)>
+ ModuleLoaderTy;
+
/// Create a Function Importer.
- FunctionImporter(
- const ModuleSummaryIndex &Index,
- std::function<std::unique_ptr<Module>(StringRef Identifier)> ModuleLoader)
+ FunctionImporter(const ModuleSummaryIndex &Index, ModuleLoaderTy ModuleLoader)
: Index(Index), ModuleLoader(std::move(ModuleLoader)) {}
/// Import functions in Module \p M based on the supplied import list.
/// \p ForceImportReferencedDiscardableSymbols will set the ModuleLinker in
/// a mode where referenced discarable symbols in the source modules will be
/// imported as well even if they are not present in the ImportList.
- bool importFunctions(Module &M, const ImportMapTy &ImportList,
- bool ForceImportReferencedDiscardableSymbols = false);
+ Expected<bool>
+ importFunctions(Module &M, const ImportMapTy &ImportList,
+ bool ForceImportReferencedDiscardableSymbols = false);
private:
/// The summaries index used to trigger importing.
const ModuleSummaryIndex &Index;
/// Factory function to load a Module for a given identifier
- std::function<std::unique_ptr<Module>(StringRef Identifier)> ModuleLoader;
+ ModuleLoaderTy ModuleLoader;
+};
+
+/// The function importing pass
+class FunctionImportPass : public PassInfoMixin<FunctionImportPass> {
+public:
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
/// Compute all the imports and exports for every module in the Index.
@@ -102,12 +113,13 @@ void ComputeCrossModuleImportForModule(
void gatherImportedSummariesForModule(
StringRef ModulePath,
const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
- const StringMap<FunctionImporter::ImportMapTy> &ImportLists,
+ const FunctionImporter::ImportMapTy &ImportList,
std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex);
+/// Emit into \p OutputFilename the files module \p ModulePath will import from.
std::error_code
EmitImportsFiles(StringRef ModulePath, StringRef OutputFilename,
- const StringMap<FunctionImporter::ImportMapTy> &ImportLists);
+ const FunctionImporter::ImportMapTy &ModuleImports);
/// Resolve WeakForLinker values in \p TheModule based on the information
/// recorded in the summaries during global summary-based analysis.
diff --git a/include/llvm/Transforms/IPO/GlobalOpt.h b/include/llvm/Transforms/IPO/GlobalOpt.h
index 5a25a6db43909..ab9116810be1b 100644
--- a/include/llvm/Transforms/IPO/GlobalOpt.h
+++ b/include/llvm/Transforms/IPO/GlobalOpt.h
@@ -24,7 +24,7 @@ namespace llvm {
/// Optimize globals that never have their address taken.
class GlobalOptPass : public PassInfoMixin<GlobalOptPass> {
public:
- PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
}
diff --git a/include/llvm/Transforms/IPO/GlobalSplit.h b/include/llvm/Transforms/IPO/GlobalSplit.h
new file mode 100644
index 0000000000000..fb2c2d27338e0
--- /dev/null
+++ b/include/llvm/Transforms/IPO/GlobalSplit.h
@@ -0,0 +1,30 @@
+//===- GlobalSplit.h - global variable splitter -----------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This pass uses inrange annotations on GEP indices to split globals where
+// beneficial. Clang currently attaches these annotations to references to
+// virtual table globals under the Itanium ABI for the benefit of the
+// whole-program virtual call optimization and control flow integrity passes.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_IPO_GLOBALSPLIT_H
+#define LLVM_TRANSFORMS_IPO_GLOBALSPLIT_H
+
+#include "llvm/IR/Module.h"
+#include "llvm/IR/PassManager.h"
+
+namespace llvm {
+/// Pass to perform split of global variables.
+class GlobalSplitPass : public PassInfoMixin<GlobalSplitPass> {
+public:
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
+};
+}
+#endif // LLVM_TRANSFORMS_IPO_GLOBALSPLIT_H
diff --git a/include/llvm/Transforms/IPO/InferFunctionAttrs.h b/include/llvm/Transforms/IPO/InferFunctionAttrs.h
index f5cbf9eb06137..54e1c243ae272 100644
--- a/include/llvm/Transforms/IPO/InferFunctionAttrs.h
+++ b/include/llvm/Transforms/IPO/InferFunctionAttrs.h
@@ -24,7 +24,7 @@ namespace llvm {
/// A pass which infers function attributes from the names and signatures of
/// function declarations in a module.
struct InferFunctionAttrsPass : PassInfoMixin<InferFunctionAttrsPass> {
- PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
/// Create a legacy pass manager instance of a pass to infer function
diff --git a/include/llvm/Transforms/IPO/Inliner.h b/include/llvm/Transforms/IPO/Inliner.h
new file mode 100644
index 0000000000000..b3ca5156e3883
--- /dev/null
+++ b/include/llvm/Transforms/IPO/Inliner.h
@@ -0,0 +1,108 @@
+//===- Inliner.h - Inliner pass and infrastructure --------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_IPO_INLINER_H
+#define LLVM_TRANSFORMS_IPO_INLINER_H
+
+#include "llvm/Analysis/CGSCCPassManager.h"
+#include "llvm/Analysis/CallGraphSCCPass.h"
+#include "llvm/Analysis/InlineCost.h"
+#include "llvm/Analysis/LazyCallGraph.h"
+#include "llvm/Analysis/TargetTransformInfo.h"
+#include "llvm/Transforms/Utils/ImportedFunctionsInliningStatistics.h"
+
+namespace llvm {
+class AssumptionCacheTracker;
+class CallSite;
+class DataLayout;
+class InlineCost;
+class OptimizationRemarkEmitter;
+class ProfileSummaryInfo;
+
+/// This class contains all of the helper code which is used to perform the
+/// inlining operations that do not depend on the policy. It contains the core
+/// bottom-up inlining infrastructure that specific inliner passes use.
+struct LegacyInlinerBase : public CallGraphSCCPass {
+ explicit LegacyInlinerBase(char &ID);
+ explicit LegacyInlinerBase(char &ID, bool InsertLifetime);
+
+ /// For this class, we declare that we require and preserve the call graph.
+ /// If the derived class implements this method, it should always explicitly
+ /// call the implementation here.
+ void getAnalysisUsage(AnalysisUsage &Info) const override;
+
+ bool doInitialization(CallGraph &CG) override;
+
+ /// Main run interface method, this implements the interface required by the
+ /// Pass class.
+ bool runOnSCC(CallGraphSCC &SCC) override;
+
+ using llvm::Pass::doFinalization;
+ /// Remove now-dead linkonce functions at the end of processing to avoid
+ /// breaking the SCC traversal.
+ bool doFinalization(CallGraph &CG) override;
+
+ /// This method must be implemented by the subclass to determine the cost of
+ /// inlining the specified call site. If the cost returned is greater than
+ /// the current inline threshold, the call site is not inlined.
+ virtual InlineCost getInlineCost(CallSite CS) = 0;
+
+ /// Remove dead functions.
+ ///
+ /// This also includes a hack in the form of the 'AlwaysInlineOnly' flag
+ /// which restricts it to deleting functions with an 'AlwaysInline'
+ /// attribute. This is useful for the InlineAlways pass that only wants to
+ /// deal with that subset of the functions.
+ bool removeDeadFunctions(CallGraph &CG, bool AlwaysInlineOnly = false);
+
+ /// This function performs the main work of the pass. The default of
+ /// Inlinter::runOnSCC() calls skipSCC() before calling this method, but
+ /// derived classes which cannot be skipped can override that method and call
+ /// this function unconditionally.
+ bool inlineCalls(CallGraphSCC &SCC);
+
+private:
+ // Insert @llvm.lifetime intrinsics.
+ bool InsertLifetime;
+
+protected:
+ AssumptionCacheTracker *ACT;
+ ProfileSummaryInfo *PSI;
+ ImportedFunctionsInliningStatistics ImportedFunctionsStats;
+};
+
+/// The inliner pass for the new pass manager.
+///
+/// This pass wires together the inlining utilities and the inline cost
+/// analysis into a CGSCC pass. It considers every call in every function in
+/// the SCC and tries to inline if profitable. It can be tuned with a number of
+/// parameters to control what cost model is used and what tradeoffs are made
+/// when making the decision.
+///
+/// It should be noted that the legacy inliners do considerably more than this
+/// inliner pass does. They provide logic for manually merging allocas, and
+/// doing considerable DCE including the DCE of dead functions. This pass makes
+/// every attempt to be simpler. DCE of functions requires complex reasoning
+/// about comdat groups, etc. Instead, it is expected that other more focused
+/// passes be composed to achieve the same end result.
+class InlinerPass : public PassInfoMixin<InlinerPass> {
+public:
+ InlinerPass(InlineParams Params = getInlineParams())
+ : Params(std::move(Params)) {}
+
+ PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
+ LazyCallGraph &CG, CGSCCUpdateResult &UR);
+
+private:
+ InlineParams Params;
+};
+
+} // End llvm namespace
+
+#endif
diff --git a/include/llvm/Transforms/IPO/InlinerPass.h b/include/llvm/Transforms/IPO/InlinerPass.h
deleted file mode 100644
index 59e10608a9ba2..0000000000000
--- a/include/llvm/Transforms/IPO/InlinerPass.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//===- InlinerPass.h - Code common to all inliners --------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines a simple policy-based bottom-up inliner. This file
-// implements all of the boring mechanics of the bottom-up inlining, while the
-// subclass determines WHAT to inline, which is the much more interesting
-// component.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TRANSFORMS_IPO_INLINERPASS_H
-#define LLVM_TRANSFORMS_IPO_INLINERPASS_H
-
-#include "llvm/Analysis/CallGraphSCCPass.h"
-
-namespace llvm {
-class AssumptionCacheTracker;
-class CallSite;
-class DataLayout;
-class InlineCost;
-class ProfileSummaryInfo;
-template <class PtrType, unsigned SmallSize> class SmallPtrSet;
-
-/// Inliner - This class contains all of the helper code which is used to
-/// perform the inlining operations that do not depend on the policy.
-///
-struct Inliner : public CallGraphSCCPass {
- explicit Inliner(char &ID);
- explicit Inliner(char &ID, bool InsertLifetime);
-
- /// getAnalysisUsage - For this class, we declare that we require and preserve
- /// the call graph. If the derived class implements this method, it should
- /// always explicitly call the implementation here.
- void getAnalysisUsage(AnalysisUsage &Info) const override;
-
- // Main run interface method, this implements the interface required by the
- // Pass class.
- bool runOnSCC(CallGraphSCC &SCC) override;
-
- using llvm::Pass::doFinalization;
- // doFinalization - Remove now-dead linkonce functions at the end of
- // processing to avoid breaking the SCC traversal.
- bool doFinalization(CallGraph &CG) override;
-
- /// getInlineCost - This method must be implemented by the subclass to
- /// determine the cost of inlining the specified call site. If the cost
- /// returned is greater than the current inline threshold, the call site is
- /// not inlined.
- ///
- virtual InlineCost getInlineCost(CallSite CS) = 0;
-
- /// removeDeadFunctions - Remove dead functions.
- ///
- /// This also includes a hack in the form of the 'AlwaysInlineOnly' flag
- /// which restricts it to deleting functions with an 'AlwaysInline'
- /// attribute. This is useful for the InlineAlways pass that only wants to
- /// deal with that subset of the functions.
- bool removeDeadFunctions(CallGraph &CG, bool AlwaysInlineOnly = false);
-
- /// This function performs the main work of the pass. The default
- /// of Inlinter::runOnSCC() calls skipSCC() before calling this method, but
- /// derived classes which cannot be skipped can override that method and
- /// call this function unconditionally.
- bool inlineCalls(CallGraphSCC &SCC);
-
-private:
- // InsertLifetime - Insert @llvm.lifetime intrinsics.
- bool InsertLifetime;
-
- /// shouldInline - Return true if the inliner should attempt to
- /// inline at the given CallSite.
- bool shouldInline(CallSite CS);
- /// Return true if inlining of CS can block the caller from being
- /// inlined which is proved to be more beneficial. \p IC is the
- /// estimated inline cost associated with callsite \p CS.
- /// \p TotalAltCost will be set to the estimated cost of inlining the caller
- /// if \p CS is suppressed for inlining.
- bool shouldBeDeferred(Function *Caller, CallSite CS, InlineCost IC,
- int &TotalAltCost);
-
-protected:
- AssumptionCacheTracker *ACT;
- ProfileSummaryInfo *PSI;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/include/llvm/Transforms/IPO/Internalize.h b/include/llvm/Transforms/IPO/Internalize.h
index ba1b06877d3a5..45d676d9f77b5 100644
--- a/include/llvm/Transforms/IPO/Internalize.h
+++ b/include/llvm/Transforms/IPO/Internalize.h
@@ -63,7 +63,7 @@ public:
/// internalizing a function (by removing any edge from the "external node")
bool internalizeModule(Module &TheModule, CallGraph *CG = nullptr);
- PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
/// Helper function to internalize functions and variables in a Module.
diff --git a/include/llvm/Transforms/IPO/LowerTypeTests.h b/include/llvm/Transforms/IPO/LowerTypeTests.h
index 93d4fb94e2c4b..23c59c199a3ba 100644
--- a/include/llvm/Transforms/IPO/LowerTypeTests.h
+++ b/include/llvm/Transforms/IPO/LowerTypeTests.h
@@ -205,7 +205,7 @@ struct ByteArrayBuilder {
class LowerTypeTestsPass : public PassInfoMixin<LowerTypeTestsPass> {
public:
- PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
} // end namespace llvm
diff --git a/include/llvm/Transforms/IPO/PartialInlining.h b/include/llvm/Transforms/IPO/PartialInlining.h
index 48eb1e30a1914..15407fc36a225 100644
--- a/include/llvm/Transforms/IPO/PartialInlining.h
+++ b/include/llvm/Transforms/IPO/PartialInlining.h
@@ -24,9 +24,6 @@ namespace llvm {
class PartialInlinerPass : public PassInfoMixin<PartialInlinerPass> {
public:
PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
-
-private:
- Function *unswitchFunction(Function *F);
};
}
#endif // LLVM_TRANSFORMS_IPO_PARTIALINLINING_H
diff --git a/include/llvm/Transforms/IPO/PassManagerBuilder.h b/include/llvm/Transforms/IPO/PassManagerBuilder.h
index 4f483deeefe5d..9f9ce467337e7 100644
--- a/include/llvm/Transforms/IPO/PassManagerBuilder.h
+++ b/include/llvm/Transforms/IPO/PassManagerBuilder.h
@@ -100,6 +100,11 @@ public:
/// peephole optimizations similar to the instruction combiner. These passes
/// will be inserted after each instance of the instruction combiner pass.
EP_Peephole,
+
+ /// EP_CGSCCOptimizerLate - This extension point allows adding CallGraphSCC
+ /// passes at the end of the main CallGraphSCC passes and before any
+ /// function simplification passes run by CGPassManager.
+ EP_CGSCCOptimizerLate,
};
/// The Optimization Level - Specify the basic optimization level.
@@ -119,9 +124,6 @@ public:
/// added to the per-module passes.
Pass *Inliner;
- /// The module summary index to use for function importing.
- const ModuleSummaryIndex *ModuleSummary;
-
bool DisableTailCalls;
bool DisableUnitAtATime;
bool DisableUnrollLoops;
@@ -130,6 +132,7 @@ public:
bool LoopVectorize;
bool RerollLoops;
bool LoadCombine;
+ bool NewGVN;
bool DisableGVNLoadPRE;
bool VerifyInput;
bool VerifyOutput;
@@ -138,10 +141,14 @@ public:
bool PrepareForThinLTO;
bool PerformThinLTO;
+ /// Enable profile instrumentation pass.
+ bool EnablePGOInstrGen;
/// Profile data file name that the instrumentation will be written to.
std::string PGOInstrGen;
/// Path of the profile data file.
std::string PGOInstrUse;
+ /// Path of the sample Profile data file.
+ std::string PGOSampleUse;
private:
/// ExtensionList - This is list of all of the extensions that are registered.
diff --git a/include/llvm/Transforms/IPO/SCCP.h b/include/llvm/Transforms/IPO/SCCP.h
index fab731342144c..7082006f14a6f 100644
--- a/include/llvm/Transforms/IPO/SCCP.h
+++ b/include/llvm/Transforms/IPO/SCCP.h
@@ -28,7 +28,7 @@ namespace llvm {
/// Pass to perform interprocedural constant propagation.
class IPSCCPPass : public PassInfoMixin<IPSCCPPass> {
public:
- PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
};
}
#endif // LLVM_TRANSFORMS_IPO_SCCP_H
diff --git a/include/llvm/Transforms/IPO/WholeProgramDevirt.h b/include/llvm/Transforms/IPO/WholeProgramDevirt.h
index 2bd20c95702c6..1aa4c6f4f559f 100644
--- a/include/llvm/Transforms/IPO/WholeProgramDevirt.h
+++ b/include/llvm/Transforms/IPO/WholeProgramDevirt.h
@@ -118,7 +118,7 @@ struct VirtualCallTarget {
// For testing only.
VirtualCallTarget(const TypeMemberInfo *TM, bool IsBigEndian)
- : Fn(nullptr), TM(TM), IsBigEndian(IsBigEndian) {}
+ : Fn(nullptr), TM(TM), IsBigEndian(IsBigEndian), WasDevirt(false) {}
// The function stored in the vtable.
Function *Fn;
@@ -134,6 +134,9 @@ struct VirtualCallTarget {
// Whether the target is big endian.
bool IsBigEndian;
+ // Whether at least one call site to the target was devirtualized.
+ bool WasDevirt;
+
// The minimum byte offset before the address point. This covers the bytes in
// the vtable object before the address point (e.g. RTTI, access-to-top,
// vtables for other base classes) and is equal to the offset from the start