Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions mlir/include/mlir/Dialect/Shard/Transforms/Simplifications.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ void populateAllReduceEndomorphismSimplificationPatterns(
auto getAlgebraicOpOperands = [](Operation *op,
SmallVector<OpOperand *> &operands) {
auto algebraicOp = llvm::cast<AlgebraicOp>(op);
std::transform(algebraicOp->getOpOperands().begin(),
algebraicOp->getOpOperands().end(),
std::back_inserter(operands),
[](OpOperand &operand) { return &operand; });
llvm::append_range(operands,
llvm::make_pointer_range(algebraicOp->getOpOperands()));
};
auto getAlgebraicOpResult = [](Operation *op) {
auto algebraicOp = llvm::cast<AlgebraicOp>(op);
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Analysis/FlatLinearValueConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ std::pair<AffineMap, AffineMap> FlatLinearConstraints::getLowerAndUpperBound(
// i - j + 1 >= 0 is the constraint, 'pos' is for i the lower bound is j
// - 1.
addCoeffs(ineq, lb);
std::transform(lb.begin(), lb.end(), lb.begin(), std::negate<int64_t>());
llvm::transform(lb, lb.begin(), std::negate<int64_t>());
auto expr =
getAffineExprFromFlatForm(lb, dimCount, symCount, localExprs, context);
// expr ceildiv divisor is (expr + divisor - 1) floordiv divisor
Expand Down Expand Up @@ -559,7 +559,7 @@ std::pair<AffineMap, AffineMap> FlatLinearConstraints::getLowerAndUpperBound(
auto eq = getEquality64(idx);
addCoeffs(eq, b);
if (eq[pos + offset] > 0)
std::transform(b.begin(), b.end(), b.begin(), std::negate<int64_t>());
llvm::transform(b, b.begin(), std::negate<int64_t>());

// Extract the upper bound (in terms of other coeff's + const).
auto expr =
Expand Down
13 changes: 5 additions & 8 deletions mlir/lib/Analysis/Presburger/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ static void normalizeDivisionByGCD(MutableArrayRef<DynamicAPInt> dividend,
}

// Normalize the dividend and the denominator.
std::transform(dividend.begin(), dividend.end(), dividend.begin(),
[gcd](DynamicAPInt &n) { return floorDiv(n, gcd); });
llvm::transform(dividend, dividend.begin(),
[gcd](DynamicAPInt &n) { return floorDiv(n, gcd); });
divisor /= gcd;
}

Expand Down Expand Up @@ -331,8 +331,7 @@ presburger::getDivLowerBound(ArrayRef<DynamicAPInt> dividend,
assert(dividend[localVarIdx] == 0 &&
"Local to be set to division must have zero coeff!");
SmallVector<DynamicAPInt, 8> ineq(dividend.size());
std::transform(dividend.begin(), dividend.end(), ineq.begin(),
std::negate<DynamicAPInt>());
llvm::transform(dividend, ineq.begin(), std::negate<DynamicAPInt>());
ineq[localVarIdx] = divisor;
ineq.back() += divisor - 1;
return ineq;
Expand Down Expand Up @@ -522,15 +521,13 @@ void DivisionRepr::dump() const { print(llvm::errs()); }
SmallVector<DynamicAPInt, 8>
presburger::getDynamicAPIntVec(ArrayRef<int64_t> range) {
SmallVector<DynamicAPInt, 8> result(range.size());
std::transform(range.begin(), range.end(), result.begin(),
dynamicAPIntFromInt64);
llvm::transform(range, result.begin(), dynamicAPIntFromInt64);
return result;
}

SmallVector<int64_t, 8> presburger::getInt64Vec(ArrayRef<DynamicAPInt> range) {
SmallVector<int64_t, 8> result(range.size());
std::transform(range.begin(), range.end(), result.begin(),
int64fromDynamicAPInt);
llvm::transform(range, result.begin(), int64fromDynamicAPInt);
return result;
}

Expand Down
3 changes: 1 addition & 2 deletions mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ void FlatAffineValueConstraints::getIneqAsAffineValueMap(

if (inequality[pos] > 0)
// Lower bound.
std::transform(bound.begin(), bound.end(), bound.begin(),
std::negate<int64_t>());
llvm::transform(bound, bound.begin(), std::negate<int64_t>());
else
// Upper bound (which is exclusive).
bound.back() += 1;
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,7 @@ static LogicalResult verifyZeroPoint(T op, Value val, const int64_t &zp,
if (!zpElemType.isInteger(8) && zp != 0) {
// convert operand to lower case for error message
std::string lower = operand;
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
llvm::transform(lower, lower.begin(), ::tolower);
return op.emitOpError()
<< lower << " zero point must be zero for non-int8 integer types";
}
Expand Down
8 changes: 4 additions & 4 deletions mlir/lib/IR/PatternMatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ Pattern::Pattern(const void *rootValue, RootKind rootKind,
if (generatedNames.empty())
return;
generatedOps.reserve(generatedNames.size());
std::transform(generatedNames.begin(), generatedNames.end(),
std::back_inserter(generatedOps), [context](StringRef name) {
return OperationName(name, context);
});
llvm::append_range(generatedOps,
llvm::map_range(generatedNames, [context](StringRef name) {
return OperationName(name, context);
}));
}

//===----------------------------------------------------------------------===//
Expand Down