Apply clang-tidy fixes for readability-simplify-boolean-expr to MLIR (NFC)

This commit is contained in:
Mehdi Amini 2022-03-07 10:12:48 +00:00
parent 03e6d10cac
commit e1f389a89f
2 changed files with 2 additions and 7 deletions

View File

@ -328,9 +328,7 @@ static bool isDivisibleBySymbol(AffineExpr expr, unsigned symbolPos,
"unexpected opKind");
switch (expr.getKind()) {
case AffineExprKind::Constant:
if (expr.cast<AffineConstantExpr>().getValue())
return false;
return true;
return expr.cast<AffineConstantExpr>().getValue() == 0;
case AffineExprKind::DimId:
return false;
case AffineExprKind::SymbolId:

View File

@ -65,10 +65,7 @@ static void applyFoldConstantExtractSlicePatterns(FuncOp funcOp) {
auto resultType = op.result().getType().cast<ShapedType>();
constexpr int64_t kConstantFoldingMaxNumElements = 1024;
if (resultType.getNumElements() > kConstantFoldingMaxNumElements)
return false;
return true;
return resultType.getNumElements() <= kConstantFoldingMaxNumElements;
};
tensor::populateFoldConstantExtractSlicePatterns(patterns, controlFn);