[PATCH] D68073: Propeller code layout optimizations

Michael Spencer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 17:41:42 PDT 2019


Bigcheese added inline comments.


================
Comment at: lld/ELF/PropellerFuncOrdering.cpp:85
+    assert(CfgSize!=0);
+    Cluster *C = new Cluster(Cfg);
+    C->Weight = CfgWeight;
----------------
Could you use unique_ptr instead? I don't see where these are deleted.


================
Comment at: lld/ELF/PropellerFuncOrdering.cpp:110
+    assert(PredecessorCfg != Cfg);
+    // log("propeller: most-likely caller of " + Twine(Cfg->Name) + " -> " + Twine(PredecessorCfg->Name));
+    auto *PredecessorCluster = ClusterMap[PredecessorCfg];
----------------
Dead code.


================
Comment at: lld/ELF/PropellerFuncOrdering.cpp:116-117
+      continue;
+    // if (PredecessorCluster->Size + Cluster->Size > (1 << 21))
+    //  continue;
+
----------------
Dead code.


================
Comment at: lld/ELF/PropellerFuncOrdering.cpp:120
+    // Join 2 clusters into PredecessorCluster.
+    *PredecessorCluster << *Cluster;
+
----------------
This should just be a function call. Using operator overloading here gains very little, and costs losing a useful function name which had to be replaced with a comment.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D68073





More information about the llvm-commits mailing list