[PATCH] D70327: [ThinLTO] Promotion handling cleanup (NFC)

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 07:33:44 PST 2019


tejohnson marked an inline comment as done.
tejohnson added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/FunctionImportUtils.cpp:272
     auto Name = GV.getName().str();
-    // Once we change the name or linkage it is difficult to determine
-    // again whether we should promote since shouldPromoteLocalToGlobal needs
-    // to locate the summary (based on GUID from name and linkage). Therefore,
-    // use DoPromote result saved above.
-    GV.setName(getName(&GV, DoPromote));
-    GV.setLinkage(getLinkage(&GV, DoPromote));
-    if (!GV.hasLocalLinkage())
-      GV.setVisibility(GlobalValue::HiddenVisibility);
+    GV.setName(getName(&GV, /* DoPromote */ true));
+    GV.setLinkage(getLinkage(&GV, /* DoPromote */ true));
----------------
evgeny777 wrote:
> Can getName() be now called with `false` as second argument? If not may be simplify it as well?
Good idea. I cleaned it up to assert that it is passed a local, and renamed to getPromotedName to clarify the behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70327





More information about the llvm-commits mailing list