[PATCH] D71847: [OpenMP][Part 1] Reusable OpenMP context/traits handling
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 14 09:06:25 PDT 2020
rnk added inline comments.
================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMPContext.h:119
+
+ SmallSet<TraitProperty, 8> RequiredTraits;
+ SmallVector<TraitProperty, 8> ConstructTraits;
----------------
jdoerfert wrote:
> rnk wrote:
> > I'd suggest that you think about different data structures here. I noticed that this instantiation of SmallSet, which wraps std::set, takes ~20ms, and happens in every file that includes OMPContext.h.
> >
> > Can you use a BitVector or std::bitset instead?
> TBH, I don't understand why this takes any time at all as it is just a type. Do you mean having `std::set` in the type is already slow?
>
> I still run test but what do you think of D76170 ?
Basically, yes, all the time is spent instantiating std::set<>::insert. This is a set of enumerators, though, which are densely packed integers with some known fixed maximum, so a bit vector seems like a more natural representation.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71847/new/
https://reviews.llvm.org/D71847
More information about the llvm-commits
mailing list