[llvm] [CodeGen] Port `LowerEmuTLS` to new pass manager (PR #75171)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 00:24:36 PST 2023


================
@@ -36,22 +37,34 @@ class LowerEmuTLS : public ModulePass {
   }
 
   bool runOnModule(Module &M) override;
-private:
-  bool addEmuTlsVar(Module &M, const GlobalVariable *GV);
-  static void copyLinkageVisibility(Module &M,
-                                    const GlobalVariable *from,
-                                    GlobalVariable *to) {
-    to->setLinkage(from->getLinkage());
-    to->setVisibility(from->getVisibility());
-    to->setDSOLocal(from->isDSOLocal());
-    if (from->hasComdat()) {
-      to->setComdat(M.getOrInsertComdat(to->getName()));
-      to->getComdat()->setSelectionKind(from->getComdat()->getSelectionKind());
----------------
paperchalice wrote:

Yes, there is a `GlobalValue::copyAttributesFrom`, but it also copies some unexpected attributes like thread local mode.

https://github.com/llvm/llvm-project/pull/75171


More information about the llvm-commits mailing list