diff options
author | Arjun P <arjunpitchanathan@gmail.com> | 2022-04-14 03:20:17 +0100 |
---|---|---|
committer | Arjun P <arjunpitchanathan@gmail.com> | 2022-04-14 04:27:21 +0100 |
commit | 094ad0667c5eb61817b68a65a89201310157e57d (patch) | |
tree | 4083740441f680896694836baff5d1e476a23bff | |
parent | ef95a6e827e5e348b310d504535ed69c0303b695 (diff) | |
download | llvm-094ad0667c5eb61817b68a65a89201310157e57d.zip llvm-094ad0667c5eb61817b68a65a89201310157e57d.tar.gz llvm-094ad0667c5eb61817b68a65a89201310157e57d.tar.bz2 |
[MLIR][Presburger] change some `push_back`s to `emplace_back`s
-rw-r--r-- | mlir/lib/Analysis/Presburger/PWMAFunction.cpp | 2 | ||||
-rw-r--r-- | mlir/lib/Analysis/Presburger/Simplex.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mlir/lib/Analysis/Presburger/PWMAFunction.cpp b/mlir/lib/Analysis/Presburger/PWMAFunction.cpp index c7906a4..851099e 100644 --- a/mlir/lib/Analysis/Presburger/PWMAFunction.cpp +++ b/mlir/lib/Analysis/Presburger/PWMAFunction.cpp @@ -55,7 +55,7 @@ MultiAffineFunction::valueAt(ArrayRef<int64_t> point) const { // of the matrix contains the constant term. Let v be the input point with // a 1 appended at the end. We can see that output * v gives the desired // output vector. - pointHomogenous.push_back(1); + pointHomogenous.emplace_back(1); SmallVector<int64_t, 8> result = output.postMultiplyWithColumn(pointHomogenous); assert(result.size() == getNumOutputs()); diff --git a/mlir/lib/Analysis/Presburger/Simplex.cpp b/mlir/lib/Analysis/Presburger/Simplex.cpp index 8fd789a..c84b761 100644 --- a/mlir/lib/Analysis/Presburger/Simplex.cpp +++ b/mlir/lib/Analysis/Presburger/Simplex.cpp @@ -1691,7 +1691,7 @@ public: else if (simplex.con[i + 1].orientation == Orientation::Column) dual.push_back(simplex.tableau(row, simplex.con[i + 1].pos)); else - dual.push_back(0); + dual.emplace_back(0); } return *maybeWidth; } @@ -1718,7 +1718,7 @@ private: coeffs.reserve(2 * dir.size()); for (int64_t coeff : dir) coeffs.push_back(-coeff); - coeffs.push_back(0); // constant term + coeffs.emplace_back(0); // constant term return coeffs; } @@ -1987,7 +1987,7 @@ Optional<SmallVector<int64_t, 8>> Simplex::findIntegerSample() { // generalized basis reduction. SmallVector<int64_t, 8> basisCoeffs = llvm::to_vector<8>(basis.getRow(level)); - basisCoeffs.push_back(0); + basisCoeffs.emplace_back(0); MaybeOptimum<int64_t> minRoundedUp, maxRoundedDown; std::tie(minRoundedUp, maxRoundedDown) = @@ -2017,7 +2017,7 @@ Optional<SmallVector<int64_t, 8>> Simplex::findIntegerSample() { if (*minRoundedUp < *maxRoundedDown) { reduceBasis(basis, level); basisCoeffs = llvm::to_vector<8>(basis.getRow(level)); - basisCoeffs.push_back(0); + basisCoeffs.emplace_back(0); std::tie(minRoundedUp, maxRoundedDown) = computeIntegerBounds(basisCoeffs); } |