[PATCH] D132848: [clang] Fix checking for emulated TLS in shouldAssumeDSOLocal in CodeGen

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 29 14:50:40 PDT 2022


efriedma added a comment.

I'm not really happy with the way this implicitly ties the implementation of this function to the implementation of TargetMachine::useEmulatedTLS().  I'd prefer to just make clang always explicitly compute whether EmullatedTLS is enabled, then always set ExplicitEmulatedTLS, so the backend can't choose something different from what the frontend thinks it should be using.  (So we always call hasDefaultEmulatedTLS() if we can't find an femulated-tls flag in CompilerInvocation.  And the ExplicitEmulatedTLS flag in clang goes away.)

Alternatively, if you think clang really shouldn't care whether emulated TLS is enabled, we could just conservatively return false from shouldAssumeDSOLocal, and let some later optimization clean it up.  Not sure what implications that has for code generation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132848



More information about the cfe-commits mailing list