[PATCH] D42816: [ThinLTO] Remove dead and dropped symbol declarations when possible

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 02:41:34 PST 2018


grimar accepted this revision.
grimar added a comment.
This revision is now accepted and ready to land.

Looks good to me. Thanks ! 
(suggestion is below)



================
Comment at: lib/LTO/LTOBackend.cpp:417
+  for (GlobalValue *GV : DeadGVs) {
+    if (!GV->use_empty()) {
+      GV->removeDeadConstantUsers();
----------------
You can skip this check I think, `removeDeadConstantUsers` 
would just do nothing in this case.

```
for (GlobalValue *GV : DeadGVs) {
  GV->removeDeadConstantUsers();

  // <comment>
  if (GV->use_empty())
    GV->eraseFromParent();
}
```


Repository:
  rL LLVM

https://reviews.llvm.org/D42816





More information about the llvm-commits mailing list