[Mlir-commits] [mlir] [mlir][Pass] Enable the option for reproducer generation without crashing (PR #75421)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Dec 13 18:02:28 PST 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff e0ca12a145be5d2a6c4e0bb6ed12b88cca3e15f9 9fd977304265940c7ced89d0a7e44fc83f3db6ce -- mlir/include/mlir/Pass/PassManager.h mlir/lib/Pass/PassCrashRecovery.cpp mlir/lib/Pass/PassDetail.h mlir/lib/Pass/PassManagerOptions.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Pass/PassCrashRecovery.cpp b/mlir/lib/Pass/PassCrashRecovery.cpp
index 4480d6797d..224584fcc5 100644
--- a/mlir/lib/Pass/PassCrashRecovery.cpp
+++ b/mlir/lib/Pass/PassCrashRecovery.cpp
@@ -176,10 +176,9 @@ void RecoveryReproducerContext::registerSignalHandler() {
struct PassCrashReproducerGenerator::Impl {
Impl(PassManager::ReproducerStreamFactory &streamFactory,
- bool localReproducer,
- bool alwaysGenerateReproducer = false)
+ bool localReproducer, bool alwaysGenerateReproducer = false)
: streamFactory(streamFactory), localReproducer(localReproducer),
- alwaysGenerateReproducer(alwaysGenerateReproducer){}
+ alwaysGenerateReproducer(alwaysGenerateReproducer) {}
/// The factory to use when generating a crash reproducer.
PassManager::ReproducerStreamFactory streamFactory;
@@ -198,7 +197,7 @@ struct PassCrashReproducerGenerator::Impl {
/// Various pass manager flags that get emitted when generating a reproducer.
bool pmFlagVerifyPasses = false;
- /// Flag indicating if reproducer generation should occur regardless of
+ /// Flag indicating if reproducer generation should occur regardless of
/// a crash or failing pass.
bool alwaysGenerateReproducer = false;
};
@@ -261,7 +260,8 @@ void PassCrashReproducerGenerator::finalize(Operation *rootOp,
<< "Failures have been detected while "
"processing an MLIR pass pipeline";
// Emit an error to the user.
- Diagnostic ¬e = diag.attachNote() << "Pipeline failed while executing [";
+ Diagnostic ¬e = diag.attachNote()
+ << "Pipeline failed while executing [";
llvm::interleaveComma(impl->runningPasses, note,
[&](const std::pair<Pass *, Operation *> &value) {
formatPassOpReproducerMessage(note, value);
@@ -443,10 +443,9 @@ void PassManager::enableCrashReproducerGeneration(
enableReproducerGeneration(factory, genLocalReproducer);
}
-void PassManager::enableReproducerGeneration(
- StringRef outputFile,
- bool genLocalReproducer,
- bool alwaysGenerateReproducer) {
+void PassManager::enableReproducerGeneration(StringRef outputFile,
+ bool genLocalReproducer,
+ bool alwaysGenerateReproducer) {
// Capture the filename by value in case outputFile is out of scope when
// invoked.
std::string filename = outputFile.str();
@@ -460,14 +459,12 @@ void PassManager::enableReproducerGeneration(
}
return std::make_unique<FileReproducerStream>(std::move(outputFile));
},
- genLocalReproducer,
- alwaysGenerateReproducer);
+ genLocalReproducer, alwaysGenerateReproducer);
}
-void PassManager::enableReproducerGeneration(
- ReproducerStreamFactory factory,
- bool genLocalReproducer,
- bool alwaysGenerateReproducer) {
+void PassManager::enableReproducerGeneration(ReproducerStreamFactory factory,
+ bool genLocalReproducer,
+ bool alwaysGenerateReproducer) {
assert(!crashReproGenerator &&
"crash reproducer has already been initialized");
if (genLocalReproducer && getContext()->isMultithreadingEnabled())
diff --git a/mlir/lib/Pass/PassDetail.h b/mlir/lib/Pass/PassDetail.h
index decc34c2af..0cddaf8a05 100644
--- a/mlir/lib/Pass/PassDetail.h
+++ b/mlir/lib/Pass/PassDetail.h
@@ -99,8 +99,7 @@ private:
class PassCrashReproducerGenerator {
public:
PassCrashReproducerGenerator(
- PassManager::ReproducerStreamFactory &streamFactory,
- bool localReproducer,
+ PassManager::ReproducerStreamFactory &streamFactory, bool localReproducer,
bool alwaysGenerateReproducer = false);
~PassCrashReproducerGenerator();
``````````
</details>
https://github.com/llvm/llvm-project/pull/75421
More information about the Mlir-commits
mailing list