Fix a few GCC compiler warnings (NFC)

This commit is contained in:
Mehdi Amini 2021-01-19 05:59:15 +00:00
parent bfbbb62b22
commit 7dadcd02d6
10 changed files with 14 additions and 8 deletions

View File

@ -11,4 +11,4 @@
#include "mlir/Dialect/Linalg/IR/LinalgOps.h"
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Linalg, linalg,
mlir::linalg::LinalgDialect);
mlir::linalg::LinalgDialect)

View File

@ -10,4 +10,4 @@
#include "mlir-c/Dialect/SCF.h"
#include "mlir/CAPI/Registration.h"
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(SCF, scf, mlir::scf::SCFDialect);
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(SCF, scf, mlir::scf::SCFDialect)

View File

@ -10,4 +10,4 @@
#include "mlir-c/Dialect/Shape.h"
#include "mlir/CAPI/Registration.h"
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Shape, shape, mlir::shape::ShapeDialect);
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Shape, shape, mlir::shape::ShapeDialect)

View File

@ -10,4 +10,4 @@
#include "mlir/CAPI/Registration.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Standard, std, mlir::StandardOpsDialect);
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Standard, std, mlir::StandardOpsDialect)

View File

@ -11,4 +11,4 @@
#include "mlir/CAPI/Registration.h"
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Tensor, tensor,
mlir::tensor::TensorDialect);
mlir::tensor::TensorDialect)

View File

@ -500,6 +500,7 @@ static unsigned buildLattices(Merger &merger, linalg::GenericOp op,
case Kind::kAddI:
return merger.takeDisj(kind, s0, s1);
}
llvm_unreachable("unexpected expression kind");
}
/// Maps sparse integer option to actual integral storage type.
@ -512,6 +513,7 @@ static Type genIntType(PatternRewriter &rewriter, linalg::SparseIntType tp) {
case linalg::SparseIntType::kI32:
return rewriter.getIntegerType(32);
}
llvm_unreachable("unexpected SparseIntType");
}
/// Local bufferization of all dense and sparse data structures.
@ -735,6 +737,7 @@ static Value genExp(Merger &merger, CodeGen &codegen, PatternRewriter &rewriter,
case Kind::kAddI:
return rewriter.create<AddIOp>(op.getLoc(), v0, v1);
}
llvm_unreachable("unexpected expression kind");
}
/// Hoists loop invariant tensor loads for which indices have been exhausted.
@ -825,6 +828,7 @@ static bool isVectorFor(CodeGen &codegen, bool isInner, bool isSparse) {
case linalg::SparseVectorizationStrategy::kAnyStorageInnerLoop:
return isInner;
}
llvm_unreachable("unexpected vectorization strategy");
}
/// Returns parallelization strategy. Any implicit loop in the Linalg operation
@ -844,6 +848,7 @@ static bool isParallelFor(CodeGen &codegen, bool isOuter, bool isReduction,
case linalg::SparseParallelizationStrategy::kAnyStorageAnyLoop:
return !isReduction && !isVector;
}
llvm_unreachable("unexpected parallelization strategy");
}
/// Generates a for-loop on a single index.

View File

@ -233,7 +233,7 @@ extern "C" void *openTensorC(char *filename, uint64_t *idata) {
double value;
for (uint64_t k = 0; k < nnz; k++) {
for (uint64_t r = 0; r < rank; r++) {
if (fscanf(file, "%" PRIu64, &indices[r]) != 1) {
if (fscanf(file, "%" PRId64, &indices[r]) != 1) {
fprintf(stderr, "Cannot find next index in %s\n", filename);
exit(1);
}

View File

@ -810,6 +810,7 @@ private:
case PDLValueKind::Value:
return read<Value>();
}
llvm_unreachable("unhandled PDLValueKind");
}
template <typename T>
std::enable_if_t<std::is_same<T, ByteCodeAddr>::value, T> readImpl() {

View File

@ -1757,7 +1757,7 @@ void OperationFormat::genElementPrinter(Element *element, OpMethodBody &body,
lastWasPunctuation);
// Emit a whitespace element.
if (NewlineElement *newline = dyn_cast<NewlineElement>(element)) {
if (isa<NewlineElement>(element)) {
body << " p.printNewline();\n";
return;
}

View File

@ -244,7 +244,7 @@ static bool isPythonKeyword(StringRef str) {
"is", "lambda", "nonlocal", "not", "or", "pass",
"raise", "return", "try", "while", "with", "yield"});
return keywords.contains(str);
};
}
/// Checks whether `str` would shadow a generated variable or attribute
/// part of the OpView API.