diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-08 05:33:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-08 05:33:04 +0000 |
commit | fc65d38085e92fa3901104c762a725788f5c9de5 (patch) | |
tree | f0fcde151478824cee933c6cd67b8947c509a73e /include | |
parent | f131fa26e6eca719e793e2fc7fe750040e9357a6 (diff) | |
download | llvm-fc65d38085e92fa3901104c762a725788f5c9de5.tar.gz llvm-fc65d38085e92fa3901104c762a725788f5c9de5.tar.bz2 llvm-fc65d38085e92fa3901104c762a725788f5c9de5.tar.xz |
Speed up the passmgr by avoiding heap thrashing on vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/PassAnalysisSupport.h | 14 | ||||
-rw-r--r-- | include/llvm/PassManagers.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index 4d19858bc9..c6ed179af6 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -20,6 +20,7 @@ #define LLVM_PASS_ANALYSIS_SUPPORT_H #include <vector> +#include "llvm/ADT/SmallVector.h" namespace llvm { @@ -34,9 +35,14 @@ namespace llvm { // Pass infrastructure through the getAnalysisUsage virtual function. // class AnalysisUsage { +public: + typedef SmallVector<AnalysisID, 32> VectorType; + +private: // Sets of analyses required and preserved by a pass - std::vector<AnalysisID> Required, RequiredTransitive, Preserved; + VectorType Required, RequiredTransitive, Preserved; bool PreservesAll; + public: AnalysisUsage() : PreservesAll(false) {} @@ -95,11 +101,11 @@ public: /// void setPreservesCFG(); - const std::vector<AnalysisID> &getRequiredSet() const { return Required; } - const std::vector<AnalysisID> &getRequiredTransitiveSet() const { + const VectorType &getRequiredSet() const { return Required; } + const VectorType &getRequiredTransitiveSet() const { return RequiredTransitive; } - const std::vector<AnalysisID> &getPreservedSet() const { return Preserved; } + const VectorType &getPreservedSet() const { return Preserved; } }; //===----------------------------------------------------------------------===// diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index bac962612f..c9944b5c87 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -309,7 +309,7 @@ public: void dumpPassInfo(Pass *P, enum PassDebuggingString S1, enum PassDebuggingString S2, const char *Msg); void dumpAnalysisSetInfo(const char *Msg, Pass *P, - const std::vector<AnalysisID> &Set) const; + const AnalysisUsage::VectorType &Set) const; virtual unsigned getNumContainedPasses() const { return (unsigned)PassVector.size(); |