Skip to content

Commit 7dadcd0

Browse files
committed
Fix a few GCC compiler warnings (NFC)
1 parent bfbbb62 commit 7dadcd0

File tree

10 files changed

+14
-8
lines changed

10 files changed

+14
-8
lines changed

mlir/lib/CAPI/Dialect/Linalg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
#include "mlir/Dialect/Linalg/IR/LinalgOps.h"
1212

1313
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Linalg, linalg,
14-
mlir::linalg::LinalgDialect);
14+
mlir::linalg::LinalgDialect)

mlir/lib/CAPI/Dialect/SCF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
#include "mlir-c/Dialect/SCF.h"
1111
#include "mlir/CAPI/Registration.h"
1212

13-
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(SCF, scf, mlir::scf::SCFDialect);
13+
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(SCF, scf, mlir::scf::SCFDialect)

mlir/lib/CAPI/Dialect/Shape.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
#include "mlir-c/Dialect/Shape.h"
1111
#include "mlir/CAPI/Registration.h"
1212

13-
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Shape, shape, mlir::shape::ShapeDialect);
13+
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Shape, shape, mlir::shape::ShapeDialect)

mlir/lib/CAPI/Dialect/Standard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
#include "mlir/CAPI/Registration.h"
1111
#include "mlir/Dialect/StandardOps/IR/Ops.h"
1212

13-
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Standard, std, mlir::StandardOpsDialect);
13+
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Standard, std, mlir::StandardOpsDialect)

mlir/lib/CAPI/Dialect/Tensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
#include "mlir/CAPI/Registration.h"
1212

1313
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Tensor, tensor,
14-
mlir::tensor::TensorDialect);
14+
mlir::tensor::TensorDialect)

mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ static unsigned buildLattices(Merger &merger, linalg::GenericOp op,
500500
case Kind::kAddI:
501501
return merger.takeDisj(kind, s0, s1);
502502
}
503+
llvm_unreachable("unexpected expression kind");
503504
}
504505

505506
/// Maps sparse integer option to actual integral storage type.
@@ -512,6 +513,7 @@ static Type genIntType(PatternRewriter &rewriter, linalg::SparseIntType tp) {
512513
case linalg::SparseIntType::kI32:
513514
return rewriter.getIntegerType(32);
514515
}
516+
llvm_unreachable("unexpected SparseIntType");
515517
}
516518

517519
/// Local bufferization of all dense and sparse data structures.
@@ -735,6 +737,7 @@ static Value genExp(Merger &merger, CodeGen &codegen, PatternRewriter &rewriter,
735737
case Kind::kAddI:
736738
return rewriter.create<AddIOp>(op.getLoc(), v0, v1);
737739
}
740+
llvm_unreachable("unexpected expression kind");
738741
}
739742

740743
/// Hoists loop invariant tensor loads for which indices have been exhausted.
@@ -825,6 +828,7 @@ static bool isVectorFor(CodeGen &codegen, bool isInner, bool isSparse) {
825828
case linalg::SparseVectorizationStrategy::kAnyStorageInnerLoop:
826829
return isInner;
827830
}
831+
llvm_unreachable("unexpected vectorization strategy");
828832
}
829833

830834
/// Returns parallelization strategy. Any implicit loop in the Linalg operation
@@ -844,6 +848,7 @@ static bool isParallelFor(CodeGen &codegen, bool isOuter, bool isReduction,
844848
case linalg::SparseParallelizationStrategy::kAnyStorageAnyLoop:
845849
return !isReduction && !isVector;
846850
}
851+
llvm_unreachable("unexpected parallelization strategy");
847852
}
848853

849854
/// Generates a for-loop on a single index.

mlir/lib/ExecutionEngine/SparseUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ extern "C" void *openTensorC(char *filename, uint64_t *idata) {
233233
double value;
234234
for (uint64_t k = 0; k < nnz; k++) {
235235
for (uint64_t r = 0; r < rank; r++) {
236-
if (fscanf(file, "%" PRIu64, &indices[r]) != 1) {
236+
if (fscanf(file, "%" PRId64, &indices[r]) != 1) {
237237
fprintf(stderr, "Cannot find next index in %s\n", filename);
238238
exit(1);
239239
}

mlir/lib/Rewrite/ByteCode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ class ByteCodeExecutor {
810810
case PDLValueKind::Value:
811811
return read<Value>();
812812
}
813+
llvm_unreachable("unhandled PDLValueKind");
813814
}
814815
template <typename T>
815816
std::enable_if_t<std::is_same<T, ByteCodeAddr>::value, T> readImpl() {

mlir/tools/mlir-tblgen/OpFormatGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ void OperationFormat::genElementPrinter(Element *element, OpMethodBody &body,
17571757
lastWasPunctuation);
17581758

17591759
// Emit a whitespace element.
1760-
if (NewlineElement *newline = dyn_cast<NewlineElement>(element)) {
1760+
if (isa<NewlineElement>(element)) {
17611761
body << " p.printNewline();\n";
17621762
return;
17631763
}

mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static bool isPythonKeyword(StringRef str) {
244244
"is", "lambda", "nonlocal", "not", "or", "pass",
245245
"raise", "return", "try", "while", "with", "yield"});
246246
return keywords.contains(str);
247-
};
247+
}
248248

249249
/// Checks whether `str` would shadow a generated variable or attribute
250250
/// part of the OpView API.

0 commit comments

Comments
 (0)