[mlir][NFC] Fix various warnings generated by GCC 9

Currently, there've been a lot of warnings while building MLIR.
This change fixes the warnings listed below.

  .../SparseTensorUtils.cpp: In instantiation of ‘...::openSparseTensorCOO(...) [with ...]’:
  .../SparseTensorUtils.cpp:1672:3:   required from here
  .../SparseTensorUtils.cpp:87:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘PrimaryType’ [-Wformat=]

  .../OptUtils.cpp:36:5: warning: this statement may fall through [-Wimplicit-fallthrough=]

  .../AffineOps.cpp:1741:32: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]

Reviewed By: aartbik, wrengr, aeubanks

Differential Revision: https://reviews.llvm.org/D128993
This commit is contained in:
Daniil Dudkin 2022-07-04 13:22:12 +03:00
parent f4dd977537
commit 42f5b0509d
3 changed files with 3 additions and 3 deletions

View File

@ -1738,7 +1738,7 @@ void AffineForOp::getCanonicalizationPatterns(RewritePatternSet &results,
/// induction variable. AffineForOp only has one region, so zero is the only
/// valid value for `index`.
OperandRange AffineForOp::getSuccessorEntryOperands(Optional<unsigned> index) {
assert(!index || *index == 0 && "invalid region index");
assert((!index || *index == 0) && "invalid region index");
// The initial operands map to the loop arguments after the induction
// variable or are forwarded to the results when the trip count is zero.

View File

@ -43,7 +43,7 @@ static Optional<OptimizationLevel> mapToLevel(unsigned optLevel,
case 2:
return OptimizationLevel::Oz;
}
break;
case 3:
return OptimizationLevel::O3;
}

View File

@ -1366,7 +1366,7 @@ openSparseTensorCOO(char *filename, uint64_t rank, const uint64_t *shape,
if ((valueKind == SparseTensorFile::ValueKind::kReal && tensorIsInteger) ||
(valueKind == SparseTensorFile::ValueKind::kComplex && tensorIsReal)) {
FATAL("Tensor element type %d not compatible with values in file %s\n",
valTp, filename);
static_cast<int>(valTp), filename);
}
stfile.assertMatchesShape(rank, shape);
// Prepare sparse tensor object with per-dimension sizes