diff --git a/mlir/include/mlir/IR/EnumAttr.td b/mlir/include/mlir/IR/EnumAttr.td --- a/mlir/include/mlir/IR/EnumAttr.td +++ b/mlir/include/mlir/IR/EnumAttr.td @@ -28,7 +28,7 @@ enumInfo.stringToSymbolFnName # [{(enumKeyword); if (maybeEnum) return *maybeEnum; - return {$_parser.emitError(loc, "expected }] # + return {(::mlir::LogicalResult)$_parser.emitError(loc, "expected }] # cppType # [{ to be one of: }] # !interleave(!foreach(enum, enumInfo.enumerants, enum.str), ", ") # [{")}; }()}]; diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp --- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp +++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp @@ -1624,7 +1624,7 @@ } auto unitVal = rewriter.create( - loc, rewriter.getIntegerAttr(resultElementTy, 1 << shift)); + loc, rewriter.getIntegerAttr(resultElementTy, 1LL << shift)); Value rightPart = dx; Value leftPart = rewriter.create(loc, unitVal, dx); diff --git a/mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp b/mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp --- a/mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp @@ -241,6 +241,7 @@ : getCmpFactory(); } + llvm_unreachable("unknown GPU AllReduceOperation"); } /// Returns an accumulator factory that creates an op of type T. diff --git a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp --- a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp +++ b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp @@ -314,10 +314,10 @@ // Perform the Taylor series approximation for atan over the range // [-1.0, 1.0]. - auto n1 = broadcast(builder, f32Cst(builder, 0.14418283), shape); - auto n2 = broadcast(builder, f32Cst(builder, -0.34999234), shape); - auto n3 = broadcast(builder, f32Cst(builder, -0.01067831), shape); - auto n4 = broadcast(builder, f32Cst(builder, 1.00209986), shape); + auto n1 = broadcast(builder, f32Cst(builder, 0.14418283f), shape); + auto n2 = broadcast(builder, f32Cst(builder, -0.34999234f), shape); + auto n3 = broadcast(builder, f32Cst(builder, -0.01067831f), shape); + auto n4 = broadcast(builder, f32Cst(builder, 1.00209986f), shape); Value p = builder.create(x, n1, n2); p = builder.create(x, p, n3); @@ -388,7 +388,7 @@ Value yLt = builder.create(arith::CmpFPredicate::OLT, y, zero); Value isNegativeHalfPiPi = builder.create(xZero, yLt); auto negativeHalfPiPi = - broadcast(builder, f32Cst(builder, -1.57079632679), shape); + broadcast(builder, f32Cst(builder, -1.57079632679f), shape); result = builder.create(isNegativeHalfPiPi, negativeHalfPiPi, result); @@ -1063,8 +1063,8 @@ return builder.create(a, b); }; - Value twoOverPi = bcast(f32Cst(builder, TWO_OVER_PI)); - Value piOverTwo = bcast(f32Cst(builder, PI_OVER_2)); + Value twoOverPi = bcast(f32Cst(builder, (float)TWO_OVER_PI)); + Value piOverTwo = bcast(f32Cst(builder, (float)PI_OVER_2)); Value x = op.getOperand(); diff --git a/mlir/lib/Parser/TypeParser.cpp b/mlir/lib/Parser/TypeParser.cpp --- a/mlir/lib/Parser/TypeParser.cpp +++ b/mlir/lib/Parser/TypeParser.cpp @@ -570,7 +570,8 @@ } else { // Make sure this integer value is in bound and valid. Optional dimension = getToken().getUInt64IntegerValue(); - if (!dimension || *dimension > std::numeric_limits::max()) + if (!dimension || + *dimension > (uint64_t)std::numeric_limits::max()) return emitError("invalid dimension"); value = (int64_t)dimension.getValue(); consumeToken(Token::integer); diff --git a/mlir/unittests/ExecutionEngine/Invoke.cpp b/mlir/unittests/ExecutionEngine/Invoke.cpp --- a/mlir/unittests/ExecutionEngine/Invoke.cpp +++ b/mlir/unittests/ExecutionEngine/Invoke.cpp @@ -31,6 +31,9 @@ using namespace mlir; +// The JIT isn't supported on Windows at that time +#ifndef _WIN32 + static struct LLVMInitializer { LLVMInitializer() { llvm::InitializeNativeTarget(); @@ -49,9 +52,6 @@ return pm.run(module); } -// The JIT isn't supported on Windows at that time -#ifndef _WIN32 - TEST(MLIRExecutionEngine, AddInteger) { std::string moduleStr = R"mlir( func @foo(%arg0 : i32) -> i32 attributes { llvm.emit_c_interface } {