[PATCH] D142318: [Support] Add PerThreadBumpPtrAllocator class.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 06:23:05 PDT 2023


avl added a comment.

In D142318#4267954 <https://reviews.llvm.org/D142318#4267954>, @avl wrote:

> It also could probably be done in more general way:
>
>   #if LLVM_ENABLE_ASSERTIONS
>   thread_local unsigned threadIndex = -1;
>   #else
>   thread_local unsigned threadIndex;
>   #endif
>   inline unsigned getThreadIndex() { 
>     assert(threadIndex != -1);
>     return threadIndex;
>   }

However, above suggestion forbids usage of the main thread which is currently used by parallelFor(). Thus the above check either should not be done either parallelFor() should be refactored to not use main thread.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142318/new/

https://reviews.llvm.org/D142318



More information about the llvm-commits mailing list