Skip to content

Commit

Permalink
Use const reference for loop variable to avoid copy (openxla#1095)
Browse files Browse the repository at this point in the history
Manually fixing as part of clang-tidy check which is currently not
supported in StableHLO openxla#61
  • Loading branch information
ghpvnist authored and atondwal committed Mar 3, 2023
1 parent 2a989e5 commit fe49f64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stablehlo/dialect/StablehloOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@ void printConvolutionDimensions(AsmPrinter& p, ConvDimensionNumbersAttr dnums) {
for (const std::pair<int64_t, NonSpatialDim>& nonSpatialDim :
non_spatialDims)
dims[nonSpatialDim.first] = nonSpatialDim.second;
for (auto spatial_dim : llvm::enumerate(spatialDims))
for (const auto& spatial_dim : llvm::enumerate(spatialDims))
dims[spatial_dim.value()] = static_cast<int64_t>(spatial_dim.index());

// Each dimension numbers will be printed as a comma separated list
Expand Down

0 comments on commit fe49f64

Please sign in to comment.