Commit f6009c25 authored by Marius Wachtler's avatar Marius Wachtler

ICInvalidator use SmallPtrSet

llvm::SmallPtrSet<ICSlotInfo*, 2> and std::unordered_set<ICSlotInfo*> have the same size
but the SmallPtrSet has the advantage that it can already store 2 elements in there and does not allocate 10 elements in the constructor
parent 1206cf29
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/iterator_range.h" #include "llvm/ADT/iterator_range.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "Python.h" #include "Python.h"
#include "core/common.h" #include "core/common.h"
...@@ -288,7 +289,7 @@ struct ParamReceiveSpec { ...@@ -288,7 +289,7 @@ struct ParamReceiveSpec {
class ICInvalidator { class ICInvalidator {
private: private:
int64_t cur_version; int64_t cur_version;
std::unordered_set<ICSlotInfo*> dependents; llvm::SmallPtrSet<ICSlotInfo*, 2> dependents;
public: public:
ICInvalidator() : cur_version(0) {} ICInvalidator() : cur_version(0) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment