[PATCH] D86351: WIP: llvm-buildozer

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 22 06:41:38 PDT 2022

aganea added inline comments.

Comment at: llvm/lib/Analysis/MemorySSA.cpp:89
-bool llvm::VerifyMemorySSA = true;
+LLVM_THREAD_LOCAL bool llvm::VerifyMemorySSA = true;
arsenm wrote:
> Do command line flags like this really need to be thread local? Wouldn't ever cl::opt need to be if this is?
This was only for the PoC.

Values pointed by `cl::opt`s -- that is either the internal `cl::opt` data or the static pointed by `cl::location` -- should be part of a context of some sort. LLD now has `CommonLinkerContext` plus a derived context per-driver. We probably need a "context" class along the same lines for the LLVM libs. Should it be part of `LLVMContextImpl`? Some options are read a bit earlier, before the `LLVMContext` is created.
The `cl::opt`s themselves can remain static.

Unless we assume `cl::opt`s are just for debugging, and move to tablegen any such globals that affect multi-threaded compilation?

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list