-
Notifications
You must be signed in to change notification settings - Fork 943
rmp: adjust naming to Google-style (excluding method names) #10193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -192,10 +192,10 @@ void Restructure::runABC() | |||||||||||||||||||||||||||||||||
| "Constants before remap {}", | ||||||||||||||||||||||||||||||||||
| countConsts(block_)); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Blif blif_( | ||||||||||||||||||||||||||||||||||
| Blif blif( | ||||||||||||||||||||||||||||||||||
| logger_, open_sta_, locell_, loport_, hicell_, hiport_, ++blif_call_id_); | ||||||||||||||||||||||||||||||||||
| blif_.setReplaceableInstances(path_insts_); | ||||||||||||||||||||||||||||||||||
| blif_.writeBlif(input_blif_file_name_.c_str(), !is_area_mode_); | ||||||||||||||||||||||||||||||||||
| blif.setReplaceableInstances(path_insts_); | ||||||||||||||||||||||||||||||||||
| blif.writeBlif(input_blif_file_name_.c_str(), !is_area_mode_); | ||||||||||||||||||||||||||||||||||
| debugPrint( | ||||||||||||||||||||||||||||||||||
| logger_, RMP, "remap", 1, "Writing blif file {}", input_blif_file_name_); | ||||||||||||||||||||||||||||||||||
| files_to_remove.emplace_back(input_blif_file_name_); | ||||||||||||||||||||||||||||||||||
|
|
@@ -206,10 +206,10 @@ void Restructure::runABC() | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (is_area_mode_) { | ||||||||||||||||||||||||||||||||||
| // Area Mode | ||||||||||||||||||||||||||||||||||
| modes = {Mode::AREA_1, Mode::AREA_2, Mode::AREA_3}; | ||||||||||||||||||||||||||||||||||
| modes = {Mode::kArea1, Mode::kArea2, Mode::kArea3}; | ||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
| // Delay Mode | ||||||||||||||||||||||||||||||||||
| modes = {Mode::DELAY_1, Mode::DELAY_2, Mode::DELAY_3, Mode::DELAY_4}; | ||||||||||||||||||||||||||||||||||
| modes = {Mode::kDelay1, Mode::kDelay2, Mode::kDelay3, Mode::kDelay4}; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| child_proc.resize(modes.size(), 0); | ||||||||||||||||||||||||||||||||||
|
|
@@ -274,8 +274,7 @@ void Restructure::runABC() | |||||||||||||||||||||||||||||||||
| int num_instances = 0; | ||||||||||||||||||||||||||||||||||
| bool success = readAbcLog(abc_log_name, level_gain, delay); | ||||||||||||||||||||||||||||||||||
| if (success) { | ||||||||||||||||||||||||||||||||||
| success | ||||||||||||||||||||||||||||||||||
| = blif_.inspectBlif(output_blif_file_name_.c_str(), num_instances); | ||||||||||||||||||||||||||||||||||
| success = blif.inspectBlif(output_blif_file_name_.c_str(), num_instances); | ||||||||||||||||||||||||||||||||||
| logger_->report( | ||||||||||||||||||||||||||||||||||
| "Optimized to {} instances in iteration {} with max path depth " | ||||||||||||||||||||||||||||||||||
| "decrease of {}, delay of {}.", | ||||||||||||||||||||||||||||||||||
|
|
@@ -293,7 +292,7 @@ void Restructure::runABC() | |||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
| // Using only DELAY_4 for delay based gain since other modes not | ||||||||||||||||||||||||||||||||||
| // showing good gains | ||||||||||||||||||||||||||||||||||
| if (modes[curr_mode_idx] == Mode::DELAY_4) { | ||||||||||||||||||||||||||||||||||
| if (modes[curr_mode_idx] == Mode::kDelay4) { | ||||||||||||||||||||||||||||||||||
| best_delay_gain = delay; | ||||||||||||||||||||||||||||||||||
| best_blif = output_blif_file_name_; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
@@ -307,7 +306,7 @@ void Restructure::runABC() | |||||||||||||||||||||||||||||||||
| || best_delay_gain < std::numeric_limits<float>::max()) { | ||||||||||||||||||||||||||||||||||
| // read back netlist | ||||||||||||||||||||||||||||||||||
| debugPrint(logger_, RMP, "remap", 1, "Reading blif file {}.", best_blif); | ||||||||||||||||||||||||||||||||||
| blif_.readBlif(best_blif.c_str(), block_); | ||||||||||||||||||||||||||||||||||
| blif.readBlif(best_blif.c_str(), block_); | ||||||||||||||||||||||||||||||||||
| debugPrint(logger_, | ||||||||||||||||||||||||||||||||||
| utl::RMP, | ||||||||||||||||||||||||||||||||||
| "remap", | ||||||||||||||||||||||||||||||||||
|
|
@@ -373,21 +372,21 @@ void Restructure::getEndPoints(sta::PinSet& ends, | |||||||||||||||||||||||||||||||||
| if (!errors.empty() && errors[0]->size() > 1) { | ||||||||||||||||||||||||||||||||||
| sta::CheckError* error = errors[0]; | ||||||||||||||||||||||||||||||||||
| bool first = true; | ||||||||||||||||||||||||||||||||||
| for (auto pinName : *error) { | ||||||||||||||||||||||||||||||||||
| debugPrint(logger_, RMP, "remap", 1, "Unconstrained pin: {}", pinName); | ||||||||||||||||||||||||||||||||||
| if (!first && open_sta_->getDbNetwork()->findPin(pinName.c_str())) { | ||||||||||||||||||||||||||||||||||
| ends.insert(open_sta_->getDbNetwork()->findPin(pinName.c_str())); | ||||||||||||||||||||||||||||||||||
| for (auto pin_name : *error) { | ||||||||||||||||||||||||||||||||||
| debugPrint(logger_, RMP, "remap", 1, "Unconstrained pin: {}", pin_name); | ||||||||||||||||||||||||||||||||||
| if (!first && open_sta_->getDbNetwork()->findPin(pin_name.c_str())) { | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: redundant call to 'c_str' [readability-redundant-string-cstr]
Suggested change
|
||||||||||||||||||||||||||||||||||
| ends.insert(open_sta_->getDbNetwork()->findPin(pin_name.c_str())); | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: redundant call to 'c_str' [readability-redundant-string-cstr]
Suggested change
|
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| first = false; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+375
to
381
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Iterating by value causes unnecessary string copies. Additionally, following the principle of analyzing loop structures to avoid redundancy, findPin should not be called multiple times for the same pin. Consider using a reference and caching the result to improve efficiency.
Suggested change
References
|
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| if (errors.size() > 1 && errors[1]->size() > 1) { | ||||||||||||||||||||||||||||||||||
| sta::CheckError* error = errors[1]; | ||||||||||||||||||||||||||||||||||
| bool first = true; | ||||||||||||||||||||||||||||||||||
| for (auto pinName : *error) { | ||||||||||||||||||||||||||||||||||
| debugPrint(logger_, RMP, "remap", 1, "Unclocked pin: {}", pinName); | ||||||||||||||||||||||||||||||||||
| if (!first && open_sta_->getDbNetwork()->findPin(pinName.c_str())) { | ||||||||||||||||||||||||||||||||||
| ends.insert(open_sta_->getDbNetwork()->findPin(pinName.c_str())); | ||||||||||||||||||||||||||||||||||
| for (auto pin_name : *error) { | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
Suggested change
|
||||||||||||||||||||||||||||||||||
| debugPrint(logger_, RMP, "remap", 1, "Unclocked pin: {}", pin_name); | ||||||||||||||||||||||||||||||||||
| if (!first && open_sta_->getDbNetwork()->findPin(pin_name.c_str())) { | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: redundant call to 'c_str' [readability-redundant-string-cstr]
Suggested change
|
||||||||||||||||||||||||||||||||||
| ends.insert(open_sta_->getDbNetwork()->findPin(pin_name.c_str())); | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: redundant call to 'c_str' [readability-redundant-string-cstr]
Suggested change
|
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| first = false; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+386
to
392
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Iterating by value causes unnecessary string copies. Additionally, following the principle of analyzing loop structures to avoid redundancy, findPin should not be called multiple times for the same pin. Consider using a reference and caching the result to improve efficiency. for (const auto& pin_name : *error) {
debugPrint(logger_, RMP, "remap", 1, "Unclocked pin: {}", pin_name);
if (!first) {
if (auto* pin = open_sta_->getDbNetwork()->findPin(pin_name.c_str())) {
ends.insert(pin);
}
}
first = false;
}References
|
||||||||||||||||||||||||||||||||||
|
|
@@ -439,7 +438,7 @@ void Restructure::removeConstCells() | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| open_sta_->clearLogicConstants(); | ||||||||||||||||||||||||||||||||||
| open_sta_->findLogicConstants(); | ||||||||||||||||||||||||||||||||||
| std::set<odb::dbInst*> constInsts; | ||||||||||||||||||||||||||||||||||
| std::set<odb::dbInst*> const_insts; | ||||||||||||||||||||||||||||||||||
| int const_cnt = 1; | ||||||||||||||||||||||||||||||||||
| for (auto inst : block_->getInsts()) { | ||||||||||||||||||||||||||||||||||
| int outputs = 0; | ||||||||||||||||||||||||||||||||||
|
|
@@ -462,16 +461,16 @@ void Restructure::removeConstCells() | |||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| outputs++; | ||||||||||||||||||||||||||||||||||
| auto pin = open_sta_->getDbNetwork()->dbToSta(iterm); | ||||||||||||||||||||||||||||||||||
| sta::LogicValue pinVal | ||||||||||||||||||||||||||||||||||
| sta::LogicValue pin_val | ||||||||||||||||||||||||||||||||||
| = open_sta_->simLogicValue(pin, open_sta_->cmdMode()); | ||||||||||||||||||||||||||||||||||
| if (pinVal == sta::LogicValue::one || pinVal == sta::LogicValue::zero) { | ||||||||||||||||||||||||||||||||||
| if (pin_val == sta::LogicValue::one || pin_val == sta::LogicValue::zero) { | ||||||||||||||||||||||||||||||||||
| odb::dbNet* net = iterm->getNet(); | ||||||||||||||||||||||||||||||||||
| if (net) { | ||||||||||||||||||||||||||||||||||
| odb::dbMaster* const_master = (pinVal == sta::LogicValue::one) | ||||||||||||||||||||||||||||||||||
| odb::dbMaster* const_master = (pin_val == sta::LogicValue::one) | ||||||||||||||||||||||||||||||||||
| ? hicell_master | ||||||||||||||||||||||||||||||||||
| : locell_master; | ||||||||||||||||||||||||||||||||||
| odb::dbMTerm* const_port | ||||||||||||||||||||||||||||||||||
| = (pinVal == sta::LogicValue::one) ? hiterm : loterm; | ||||||||||||||||||||||||||||||||||
| = (pin_val == sta::LogicValue::one) ? hiterm : loterm; | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+469
to
+473
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The condition
Suggested change
|
||||||||||||||||||||||||||||||||||
| std::string inst_name = "rmp_const_" + std::to_string(const_cnt); | ||||||||||||||||||||||||||||||||||
| debugPrint(logger_, | ||||||||||||||||||||||||||||||||||
| RMP, | ||||||||||||||||||||||||||||||||||
|
|
@@ -495,19 +494,19 @@ void Restructure::removeConstCells() | |||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| if (outputs > 0 && outputs == const_outputs) { | ||||||||||||||||||||||||||||||||||
| constInsts.insert(inst); | ||||||||||||||||||||||||||||||||||
| const_insts.insert(inst); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| open_sta_->clearLogicConstants(); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| debugPrint( | ||||||||||||||||||||||||||||||||||
| logger_, RMP, "remap", 2, "Removing {} instances...", constInsts.size()); | ||||||||||||||||||||||||||||||||||
| logger_, RMP, "remap", 2, "Removing {} instances...", const_insts.size()); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| for (auto inst : constInsts) { | ||||||||||||||||||||||||||||||||||
| for (auto inst : const_insts) { | ||||||||||||||||||||||||||||||||||
| removeConstCell(inst); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| logger_->report("Removed {} instances with constant outputs.", | ||||||||||||||||||||||||||||||||||
| constInsts.size()); | ||||||||||||||||||||||||||||||||||
| const_insts.size()); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| void Restructure::removeConstCell(odb::dbInst* inst) | ||||||||||||||||||||||||||||||||||
|
|
@@ -572,19 +571,19 @@ void Restructure::writeOptCommands(std::ofstream& script) | |||||||||||||||||||||||||||||||||
| script << choice << '\n'; | ||||||||||||||||||||||||||||||||||
| script << choice2 << '\n'; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (opt_mode_ == Mode::AREA_3) { | ||||||||||||||||||||||||||||||||||
| if (opt_mode_ == Mode::kArea3) { | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; // << "scleanup" << std::endl; | ||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
| script << "resyn2\n"; // << "scleanup" << std::endl; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| switch (opt_mode_) { | ||||||||||||||||||||||||||||||||||
| case Mode::DELAY_1: { | ||||||||||||||||||||||||||||||||||
| case Mode::kDelay1: { | ||||||||||||||||||||||||||||||||||
| script << "map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n"; | ||||||||||||||||||||||||||||||||||
| script << "buffer -p -c\n"; | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| case Mode::DELAY_2: { | ||||||||||||||||||||||||||||||||||
| case Mode::kDelay2: { | ||||||||||||||||||||||||||||||||||
| script << "choice\n"; | ||||||||||||||||||||||||||||||||||
| script << "map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n"; | ||||||||||||||||||||||||||||||||||
| script << "choice\n"; | ||||||||||||||||||||||||||||||||||
|
|
@@ -593,7 +592,7 @@ void Restructure::writeOptCommands(std::ofstream& script) | |||||||||||||||||||||||||||||||||
| << "topo\n"; | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| case Mode::DELAY_3: { | ||||||||||||||||||||||||||||||||||
| case Mode::kDelay3: { | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; | ||||||||||||||||||||||||||||||||||
| script << "map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n"; | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; | ||||||||||||||||||||||||||||||||||
|
|
@@ -602,23 +601,23 @@ void Restructure::writeOptCommands(std::ofstream& script) | |||||||||||||||||||||||||||||||||
| << "topo\n"; | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| case Mode::DELAY_4: { | ||||||||||||||||||||||||||||||||||
| case Mode::kDelay4: { | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; | ||||||||||||||||||||||||||||||||||
| script << "amap -F 20 -A 20 -C 5000 -Q 0.1 -m\n"; | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; | ||||||||||||||||||||||||||||||||||
| script << "map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n"; | ||||||||||||||||||||||||||||||||||
| script << "buffer -p -c\n"; | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| case Mode::AREA_2: | ||||||||||||||||||||||||||||||||||
| case Mode::AREA_3: { | ||||||||||||||||||||||||||||||||||
| case Mode::kArea2: | ||||||||||||||||||||||||||||||||||
| case Mode::kArea3: { | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; | ||||||||||||||||||||||||||||||||||
| script << "amap -m -Q 0.1 -F 20 -A 20 -C 5000\n"; | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; | ||||||||||||||||||||||||||||||||||
| script << "amap -m -Q 0.1 -F 20 -A 20 -C 5000\n"; | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| case Mode::AREA_1: | ||||||||||||||||||||||||||||||||||
| case Mode::kArea1: | ||||||||||||||||||||||||||||||||||
| default: { | ||||||||||||||||||||||||||||||||||
| script << "choice2\n"; | ||||||||||||||||||||||||||||||||||
| script << "amap -m -Q 0.1 -F 20 -A 20 -C 5000\n"; | ||||||||||||||||||||||||||||||||||
|
|
@@ -633,27 +632,27 @@ void Restructure::setMode(const char* mode_name) | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (!strcmp(mode_name, "timing")) { | ||||||||||||||||||||||||||||||||||
| is_area_mode_ = false; | ||||||||||||||||||||||||||||||||||
| opt_mode_ = Mode::DELAY_1; | ||||||||||||||||||||||||||||||||||
| opt_mode_ = Mode::kDelay1; | ||||||||||||||||||||||||||||||||||
| } else if (!strcmp(mode_name, "area")) { | ||||||||||||||||||||||||||||||||||
| opt_mode_ = Mode::AREA_1; | ||||||||||||||||||||||||||||||||||
| opt_mode_ = Mode::kArea1; | ||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
| logger_->warn(RMP, 10, "Mode {} not recognized.", mode_name); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| void Restructure::setTieHiPort(sta::LibertyPort* tieHiPort) | ||||||||||||||||||||||||||||||||||
| void Restructure::setTieHiPort(sta::LibertyPort* tie_hi_port) | ||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| if (tieHiPort) { | ||||||||||||||||||||||||||||||||||
| hicell_ = tieHiPort->libertyCell()->name(); | ||||||||||||||||||||||||||||||||||
| hiport_ = tieHiPort->name(); | ||||||||||||||||||||||||||||||||||
| if (tie_hi_port) { | ||||||||||||||||||||||||||||||||||
| hicell_ = tie_hi_port->libertyCell()->name(); | ||||||||||||||||||||||||||||||||||
| hiport_ = tie_hi_port->name(); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| void Restructure::setTieLoPort(sta::LibertyPort* tieLoPort) | ||||||||||||||||||||||||||||||||||
| void Restructure::setTieLoPort(sta::LibertyPort* tie_lo_port) | ||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| if (tieLoPort) { | ||||||||||||||||||||||||||||||||||
| locell_ = tieLoPort->libertyCell()->name(); | ||||||||||||||||||||||||||||||||||
| loport_ = tieLoPort->name(); | ||||||||||||||||||||||||||||||||||
| if (tie_lo_port) { | ||||||||||||||||||||||||||||||||||
| locell_ = tie_lo_port->libertyCell()->name(); | ||||||||||||||||||||||||||||||||||
| loport_ = tie_lo_port->name(); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]