Skip to content

Commit edf3154

Browse files
committed
mpl: fix performance inefficiencies from coverity scan
Signed-off-by: Arthur Koucher <[email protected]>
1 parent ad56431 commit edf3154

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/mpl/src/SACoreSoftMacro.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ void SACoreSoftMacro::fillDeadSpace()
871871
const int num_y = y_grid.size() - 1;
872872
for (int j = 0; j < num_y; j++) {
873873
std::vector<int> macro_ids(num_x, -1);
874-
grids.push_back(macro_ids);
874+
grids.push_back(std::move(macro_ids));
875875
}
876876

877877
for (int macro_id = 0; macro_id < pos_seq_.size(); macro_id++) {

src/mpl/src/clusterEngine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ DataFlowHypergraph ClusteringEngine::computeHypergraph(
871871
for (int i = 1; i < hyperedge.size(); i++) {
872872
graph.backward_vertices[hyperedge[i]].push_back(graph.hyperedges.size());
873873
}
874-
graph.hyperedges.push_back(hyperedge);
874+
graph.hyperedges.push_back(std::move(hyperedge));
875875
}
876876

877877
return graph;
@@ -1600,7 +1600,7 @@ void ClusteringEngine::breakLargeFlatCluster(Cluster* parent)
16001600
&& loads_id.size() < tree_->large_net_threshold) {
16011601
std::vector<int> hyperedge;
16021602
hyperedge.insert(hyperedge.end(), loads_id.begin(), loads_id.end());
1603-
hyperedges.push_back(hyperedge);
1603+
hyperedges.push_back(std::move(hyperedge));
16041604
}
16051605
}
16061606

@@ -2105,7 +2105,7 @@ void ClusteringEngine::fetchMixedLeaves(
21052105
// We push the leaves after finishing searching the children so
21062106
// that each vector of clusters represents the children of one
21072107
// parent.
2108-
mixed_leaves.push_back(sister_mixed_leaves);
2108+
mixed_leaves.push_back(std::move(sister_mixed_leaves));
21092109
}
21102110

21112111
void ClusteringEngine::breakMixedLeaves(

src/mpl/src/hier_rtlmp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ void HierRTLMP::calculateChildrenTilings(Cluster* parent)
416416
macro.setShapes(width_intervals, tilings.front().area());
417417
}
418418

419-
macros.push_back(macro);
419+
macros.push_back(std::move(macro));
420420
}
421421
}
422422
// if there is only one soft macro

0 commit comments

Comments
 (0)