diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-07-22 11:47:54 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-07-22 11:47:54 +0000 |
commit | f3af4af6b5ca904c83d9846321d2618b920df2a3 (patch) | |
tree | 4c3a86322a870f8799bd8151662e42869a7b80c9 /llvm/lib/Analysis | |
parent | 56e2c62a8d1bc3337f022c02c3865916faa9f440 (diff) | |
download | bcm5719-llvm-f3af4af6b5ca904c83d9846321d2618b920df2a3.tar.gz bcm5719-llvm-f3af4af6b5ca904c83d9846321d2618b920df2a3.zip |
[GMR] Switch from std::set to SmallPtrSet. NFC.
This almost certainly doesn't matter in some deep sense, but std::set is
essentially always going to be slower here. Now the alias query should
be essentially constant time instead of having to chase the set tree
each time.
llvm-svn: 242893
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/IPA/GlobalsModRef.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp index c0fb3cdae1f..a1df8b140d7 100644 --- a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp @@ -16,6 +16,7 @@ #include "llvm/Analysis/Passes.h" #include "llvm/ADT/SCCIterator.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CallGraph.h" @@ -30,7 +31,6 @@ #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" #include <list> -#include <set> using namespace llvm; #define DEBUG_TYPE "globalsmodref-aa" @@ -89,11 +89,11 @@ struct FunctionRecord { /// GlobalsModRef - The actual analysis pass. class GlobalsModRef : public ModulePass, public AliasAnalysis { /// The globals that do not have their addresses taken. - std::set<const GlobalValue *> NonAddressTakenGlobals; + SmallPtrSet<const GlobalValue *, 8> NonAddressTakenGlobals; /// IndirectGlobals - The memory pointed to by this global is known to be /// 'owned' by the global. - std::set<const GlobalValue *> IndirectGlobals; + SmallPtrSet<const GlobalValue *, 8> IndirectGlobals; /// AllocsForIndirectGlobals - If an instruction allocates memory for an /// indirect global, this map indicates which one. |