[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Nov 12 20:15:12 PST 2024
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 8a49434df62e394cd109f0189349b4d28dafa525 b59db4636891df96b7569c9737e361431f898909 --extensions cpp,h -- mlir/include/mlir/IR/Builders.h mlir/include/mlir/Transforms/DialectConversion.h mlir/lib/Dialect/Func/Transforms/DecomposeCallGraphTypes.cpp mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorDescriptor.cpp mlir/lib/IR/Builders.cpp mlir/lib/Transforms/Utils/DialectConversion.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index 23d7b05982..a0cf52b462 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -1443,16 +1443,15 @@ void ConversionPatternRewriterImpl::notifyOpReplaced(
// Remap result to replacement value.
if (repl.empty())
continue;
-
+
if (repl.size() == 1) {
// Single replacement value: replace directly.
mapping.map(result, repl.front());
} else {
// Multiple replacement values: insert N:1 materialization.
- insertNTo1Materialization(OpBuilder::InsertPoint::after(repl, &domInfo),
- result.getLoc(),
- /*replacements=*/repl, /*outputValue=*/result,
- currentTypeConverter);
+ insertNTo1Materialization(
+ OpBuilder::InsertPoint::after(repl, &domInfo), result.getLoc(),
+ /*replacements=*/repl, /*outputValue=*/result, currentTypeConverter);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/115816
More information about the llvm-branch-commits
mailing list