forked from OSchip/llvm-project
[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:
parent
f4dd977537
commit
42f5b0509d
|
@ -1738,7 +1738,7 @@ void AffineForOp::getCanonicalizationPatterns(RewritePatternSet &results,
|
||||||
/// induction variable. AffineForOp only has one region, so zero is the only
|
/// induction variable. AffineForOp only has one region, so zero is the only
|
||||||
/// valid value for `index`.
|
/// valid value for `index`.
|
||||||
OperandRange AffineForOp::getSuccessorEntryOperands(Optional<unsigned> 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
|
// The initial operands map to the loop arguments after the induction
|
||||||
// variable or are forwarded to the results when the trip count is zero.
|
// variable or are forwarded to the results when the trip count is zero.
|
||||||
|
|
|
@ -43,7 +43,7 @@ static Optional<OptimizationLevel> mapToLevel(unsigned optLevel,
|
||||||
case 2:
|
case 2:
|
||||||
return OptimizationLevel::Oz;
|
return OptimizationLevel::Oz;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
return OptimizationLevel::O3;
|
return OptimizationLevel::O3;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1366,7 +1366,7 @@ openSparseTensorCOO(char *filename, uint64_t rank, const uint64_t *shape,
|
||||||
if ((valueKind == SparseTensorFile::ValueKind::kReal && tensorIsInteger) ||
|
if ((valueKind == SparseTensorFile::ValueKind::kReal && tensorIsInteger) ||
|
||||||
(valueKind == SparseTensorFile::ValueKind::kComplex && tensorIsReal)) {
|
(valueKind == SparseTensorFile::ValueKind::kComplex && tensorIsReal)) {
|
||||||
FATAL("Tensor element type %d not compatible with values in file %s\n",
|
FATAL("Tensor element type %d not compatible with values in file %s\n",
|
||||||
valTp, filename);
|
static_cast<int>(valTp), filename);
|
||||||
}
|
}
|
||||||
stfile.assertMatchesShape(rank, shape);
|
stfile.assertMatchesShape(rank, shape);
|
||||||
// Prepare sparse tensor object with per-dimension sizes
|
// Prepare sparse tensor object with per-dimension sizes
|
||||||
|
|
Loading…
Reference in New Issue