[Mlir-commits] [mlir] [memref] Support dense resources for memref-to-llvm (PR #79380)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jan 24 14:20:01 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 36e4a7ecca8a79fe8960a1e2afa78fbbd643dc7f 479358627d2794cc929182d648fc8ac6b42e1d72 -- mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp b/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
index 8fd1f37acd..0892e93fa9 100644
--- a/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
+++ b/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
@@ -503,17 +503,18 @@ struct GlobalMemrefOpLowering
Attribute initialValue = nullptr;
if (!global.isExternal() && !global.isUninitialized()) {
Attribute initialAttr = *global.getInitialValue();
- if (auto resourceAttr = llvm::dyn_cast<DenseResourceElementsAttr>(initialAttr)) {
+ if (auto resourceAttr =
+ llvm::dyn_cast<DenseResourceElementsAttr>(initialAttr)) {
auto blob = resourceAttr.getRawHandle().getBlob();
initialAttr = DenseElementsAttr::getFromRawBuffer(
- resourceAttr.getType(), blob->getData());
- }
+ resourceAttr.getType(), blob->getData());
+ }
if (auto elementsAttr = llvm::cast<ElementsAttr>(initialAttr)) {
initialValue = elementsAttr;
- // For scalar memrefs, the global variable created is of the element type,
- // so unpack the elements attribute to extract the value.
+ // For scalar memrefs, the global variable created is of the element
+ // type, so unpack the elements attribute to extract the value.
if (type.getRank() == 0)
initialValue = elementsAttr.getSplatValue<Attribute>();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/79380
More information about the Mlir-commits
mailing list