diff --git a/build_tools/github_actions/lint_clang_format.sh b/build_tools/github_actions/lint_clang_format.sh index 42a77e8977c..e3cc00d3dea 100755 --- a/build_tools/github_actions/lint_clang_format.sh +++ b/build_tools/github_actions/lint_clang_format.sh @@ -45,7 +45,7 @@ fi echo "Running clang-format [mode=$FORMAT_MODE]..." echo " Files: $CHANGED_FILES" if [[ $FORMAT_MODE == 'fix' ]]; then - clang-format --style=google -i "$CHANGED_FILES" + clang-format --style=google -i $CHANGED_FILES else - clang-format --style=google --dry-run --Werror "$CHANGED_FILES" + clang-format --style=google --dry-run --Werror $CHANGED_FILES fi diff --git a/stablehlo/transforms/StablehloCanonicalizeDynamism.cpp b/stablehlo/transforms/StablehloCanonicalizeDynamism.cpp index 5c944190a83..6f81d8fe7e6 100644 --- a/stablehlo/transforms/StablehloCanonicalizeDynamism.cpp +++ b/stablehlo/transforms/StablehloCanonicalizeDynamism.cpp @@ -308,8 +308,11 @@ struct StablehloCanonicalizeDynamismPass RewritePatternSet patterns(&getContext()); populateStablehloCanonicalizeDynamismPatterns(&patterns, &getContext()); - if (failed(applyPatternsAndFoldGreedily(getOperation(), std::move(patterns), - config))) { + auto func = getOperation(); + if (failed( + applyPatternsAndFoldGreedily(func, std::move(patterns), config))) { + func.emitError("Failed to converge StablehloCanonicalizeDynamism in ") + << config.maxIterations << " iterations"; return signalPassFailure(); } } diff --git a/stablehlo/transforms/StablehloRefineShapes.cpp b/stablehlo/transforms/StablehloRefineShapes.cpp index f8de6333093..cfc29fe6d5a 100644 --- a/stablehlo/transforms/StablehloRefineShapes.cpp +++ b/stablehlo/transforms/StablehloRefineShapes.cpp @@ -1082,9 +1082,12 @@ struct StablehloRefineShapesPass config.strictMode = GreedyRewriteStrictness::AnyOp; RewritePatternSet patterns(&getContext()); + populateStablehloRefineShapesPatterns(&patterns, &getContext()); if (failed( applyPatternsAndFoldGreedily(func, std::move(patterns), config))) { + func.emitError("Failed to converge StablehloRefineShapes in ") + << config.maxIterations << " iterations"; return signalPassFailure(); } }