Skip to content

Commit a9a0ea9

Browse files
committed
[mlir] Update Erf approximation.
1 parent d43f779 commit a9a0ea9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ static Value exp2I32(ImplicitLocOpBuilder &builder, Value arg) {
198198
namespace {
199199
Value makePolynomialCalculation(ImplicitLocOpBuilder &builder,
200200
llvm::ArrayRef<Value> coeffs, Value x) {
201-
auto width = vectorWidth(x.getType(), isF32);
201+
auto shape = vectorShape(x.getType(), isF32);
202202
if (coeffs.size() == 0) {
203-
return broadcast(builder, f32Cst(builder, 0.0f), *width);
203+
return broadcast(builder, f32Cst(builder, 0.0f), *shape);
204204
} else if (coeffs.size() == 1) {
205205
return coeffs[0];
206206
}
@@ -509,13 +509,13 @@ Log1pApproximation::matchAndRewrite(math::Log1pOp op,
509509
LogicalResult
510510
ErfPolynomialApproximation::matchAndRewrite(math::ErfOp op,
511511
PatternRewriter &rewriter) const {
512-
auto width = vectorWidth(op.operand().getType(), isF32);
513-
if (!width.hasValue())
512+
auto shape = vectorShape(op.operand().getType(), isF32);
513+
if (!shape.hasValue())
514514
return rewriter.notifyMatchFailure(op, "unsupported operand type");
515515

516516
ImplicitLocOpBuilder builder(op->getLoc(), rewriter);
517517
auto bcast = [&](Value value) -> Value {
518-
return broadcast(builder, value, *width);
518+
return broadcast(builder, value, *shape);
519519
};
520520

521521
const int intervalsCount = 3;

0 commit comments

Comments
 (0)