[Mlir-commits] [mlir] [MLIR] Fix `BubbleDownVectorBitCastForExtract` crash on non-static index (PR #116518)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Nov 16 17:33:46 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 73bb022b469a32eb5aee30f2947f3cea5e903caa 3d940ccaf238090edf26032edcbe9ab57683a42b --extensions cpp -- mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
index 3745bee98f..55ab00e0cf 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
@@ -596,13 +596,15 @@ struct BubbleDownVectorBitCastForExtract
     unsigned expandRatio =
         castDstType.getNumElements() / castSrcType.getNumElements();
 
-    auto getFirstIntValue = [](ArrayRef<OpFoldResult> values) -> std::optional<uint64_t> {
+    auto getFirstIntValue =
+        [](ArrayRef<OpFoldResult> values) -> std::optional<uint64_t> {
       if (!values[0].is<Attribute>())
         return std::nullopt;
       return cast<IntegerAttr>(values[0].get<Attribute>()).getInt();
     };
 
-    std::optional<uint64_t> optIndex = getFirstIntValue(extractOp.getMixedPosition());
+    std::optional<uint64_t> optIndex =
+        getFirstIntValue(extractOp.getMixedPosition());
     if (!optIndex)
       return failure();
     uint64_t index = *optIndex;

``````````

</details>


https://github.com/llvm/llvm-project/pull/116518


More information about the Mlir-commits mailing list