[PATCH] D158859: Cleaning up unreachable code in CodeLayout

Sergey Pupyrev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 09:22:42 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb4b42bd6522f: Cleaning up unreachable code in CodeLayout (authored by spupyrev).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158859

Files:
  llvm/lib/Transforms/Utils/CodeLayout.cpp


Index: llvm/lib/Transforms/Utils/CodeLayout.cpp
===================================================================
--- llvm/lib/Transforms/Utils/CodeLayout.cpp
+++ llvm/lib/Transforms/Utils/CodeLayout.cpp
@@ -952,7 +952,6 @@
                 const double DL = ChainDensity[L];
                 const double DR = ChainDensity[R];
                 // Compare by density and break ties by chain identifiers.
-                return (DL != DR) ? (DL > DR) : (L->Id < R->Id);
                 return std::make_tuple(-DL, L->Id) <
                        std::make_tuple(-DR, R->Id);
               });
@@ -1104,7 +1103,7 @@
 
     // Insert the edges into the queue.
     for (ChainT *ChainPred : HotChains) {
-      for (const auto &[Chain, Edge] : ChainPred->Edges) {
+      for (const auto &[_, Edge] : ChainPred->Edges) {
         // Ignore self-edges.
         if (Edge->isSelfEdge())
           continue;
@@ -1137,9 +1136,9 @@
       ChainT *BestDstChain = BestEdge->dstChain();
 
       // Remove outdated edges from the queue.
-      for (const auto &[Chain, ChainEdge] : BestSrcChain->Edges)
+      for (const auto &[_, ChainEdge] : BestSrcChain->Edges)
         Queue.erase(ChainEdge);
-      for (const auto &[Chain, ChainEdge] : BestDstChain->Edges)
+      for (const auto &[_, ChainEdge] : BestDstChain->Edges)
         Queue.erase(ChainEdge);
 
       // Merge the best pair of chains.
@@ -1148,7 +1147,7 @@
                   BestGain.mergeType());
 
       // Insert newly created edges into the queue.
-      for (const auto &[Chain, Edge] : BestSrcChain->Edges) {
+      for (const auto &[_, Edge] : BestSrcChain->Edges) {
         // Ignore loop edges.
         if (Edge->isSelfEdge())
           continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158859.553965.patch
Type: text/x-patch
Size: 1722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230828/f76fd22d/attachment.bin>


More information about the llvm-commits mailing list