[Mlir-commits] [mlir] 654e65d - [mlir] Apply ClangTidy performance fix.

Adrian Kuegel llvmlistbot at llvm.org
Wed Feb 21 05:17:54 PST 2024


Author: Adrian Kuegel
Date: 2024-02-21T13:17:43Z
New Revision: 654e65d3b20835b4959d4d591e179814914ab5e2

URL: https://github.com/llvm/llvm-project/commit/654e65d3b20835b4959d4d591e179814914ab5e2
DIFF: https://github.com/llvm/llvm-project/commit/654e65d3b20835b4959d4d591e179814914ab5e2.diff

LOG: [mlir] Apply ClangTidy performance fix.

Use const reference for loop variable.

Added: 
    

Modified: 
    mlir/lib/Analysis/Presburger/Barvinok.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/Presburger/Barvinok.cpp b/mlir/lib/Analysis/Presburger/Barvinok.cpp
index b6d1f99df8ba55..4be81c25951b84 100644
--- a/mlir/lib/Analysis/Presburger/Barvinok.cpp
+++ b/mlir/lib/Analysis/Presburger/Barvinok.cpp
@@ -425,7 +425,7 @@ mlir::presburger::detail::computePolytopeGeneratingFunction(
     // cones.
     GeneratingFunction vertexGf(numSymbols, {}, {}, {});
     SmallVector<std::pair<int, ConeH>, 4> unimodCones = {{1, tangentCone}};
-    for (std::pair<int, ConeH> signedCone : unimodCones) {
+    for (const std::pair<int, ConeH> &signedCone : unimodCones) {
       auto [sign, cone] = signedCone;
       vertexGf = vertexGf +
                  computeUnimodularConeGeneratingFunction(*vertex, sign, cone);
@@ -785,4 +785,4 @@ mlir::presburger::detail::computeNumTerms(const GeneratingFunction &gf) {
   }
 
   return totalTerm.simplify();
-}
\ No newline at end of file
+}


        


More information about the Mlir-commits mailing list