Skip to content

Commit

Permalink
[mlir] Fix warnings
Browse files Browse the repository at this point in the history
This patch fixes:

  mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp:171:30:
  warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]

  mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp:283:30:
  warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  • Loading branch information
kazutakahirata committed Oct 15, 2022
1 parent 39f0124 commit 75076f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ handleMultidimensionalVectors(ImplicitLocOpBuilder &builder,

static Value floatCst(ImplicitLocOpBuilder &builder, float value,
Type elementType) {
assert(elementType.isF16() ||
elementType.isF32() && "x must be f16 or f32 type.");
assert((elementType.isF16() || elementType.isF32()) &&
"x must be f16 or f32 type.");
return builder.create<arith::ConstantOp>(
builder.getFloatAttr(elementType, value));
}
Expand Down Expand Up @@ -279,8 +279,8 @@ namespace {
Value makePolynomialCalculation(ImplicitLocOpBuilder &builder,
llvm::ArrayRef<Value> coeffs, Value x) {
Type elementType = getElementTypeOrSelf(x);
assert(elementType.isF32() ||
elementType.isF16() && "x must be f32 or f16 type");
assert((elementType.isF32() || elementType.isF16()) &&
"x must be f32 or f16 type");
ArrayRef<int64_t> shape = vectorShape(x);

if (coeffs.empty())
Expand Down

0 comments on commit 75076f8

Please sign in to comment.