Skip to content

Commit b4b42bd

Browse files
author
spupyrev
committed
Cleaning up unreachable code in CodeLayout
- removing an unreachable instruction from the code (earlier code merge bug); - silencing "unused variable" warnings. Reviewed By: rahmanl Differential Revision: https://reviews.llvm.org/D158859
1 parent 0f1c1be commit b4b42bd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Transforms/Utils/CodeLayout.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,6 @@ class ExtTSPImpl {
952952
const double DL = ChainDensity[L];
953953
const double DR = ChainDensity[R];
954954
// Compare by density and break ties by chain identifiers.
955-
return (DL != DR) ? (DL > DR) : (L->Id < R->Id);
956955
return std::make_tuple(-DL, L->Id) <
957956
std::make_tuple(-DR, R->Id);
958957
});
@@ -1104,7 +1103,7 @@ class CDSortImpl {
11041103

11051104
// Insert the edges into the queue.
11061105
for (ChainT *ChainPred : HotChains) {
1107-
for (const auto &[Chain, Edge] : ChainPred->Edges) {
1106+
for (const auto &[_, Edge] : ChainPred->Edges) {
11081107
// Ignore self-edges.
11091108
if (Edge->isSelfEdge())
11101109
continue;
@@ -1137,9 +1136,9 @@ class CDSortImpl {
11371136
ChainT *BestDstChain = BestEdge->dstChain();
11381137

11391138
// Remove outdated edges from the queue.
1140-
for (const auto &[Chain, ChainEdge] : BestSrcChain->Edges)
1139+
for (const auto &[_, ChainEdge] : BestSrcChain->Edges)
11411140
Queue.erase(ChainEdge);
1142-
for (const auto &[Chain, ChainEdge] : BestDstChain->Edges)
1141+
for (const auto &[_, ChainEdge] : BestDstChain->Edges)
11431142
Queue.erase(ChainEdge);
11441143

11451144
// Merge the best pair of chains.
@@ -1148,7 +1147,7 @@ class CDSortImpl {
11481147
BestGain.mergeType());
11491148

11501149
// Insert newly created edges into the queue.
1151-
for (const auto &[Chain, Edge] : BestSrcChain->Edges) {
1150+
for (const auto &[_, Edge] : BestSrcChain->Edges) {
11521151
// Ignore loop edges.
11531152
if (Edge->isSelfEdge())
11541153
continue;

0 commit comments

Comments
 (0)