[Mlir-commits] [llvm] [mlir] [mlir][affine] Add optional alignment attribute to affine load/store ops (PR #214532)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Aug 6 15:50:17 PDT 2026
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 origin/main HEAD --extensions h,cpp -- mlir/include/mlir/Dialect/Affine/IR/AffineOps.h mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp mlir/lib/Dialect/Affine/IR/AffineOps.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
index 99befe11e..c5cd8c6c3 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
@@ -15,11 +15,11 @@
#define MLIR_DIALECT_AFFINE_IR_AFFINEOPS_H
#include "mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.h"
-#include "mlir/Interfaces/AlignmentAttrInterface.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Builders.h"
+#include "mlir/Interfaces/AlignmentAttrInterface.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
namespace mlir {
diff --git a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
index ffc8c4049..367826c93 100644
--- a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
+++ b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
@@ -364,10 +364,9 @@ public:
return failure();
// Build memref.load memref[expandedMap.results].
- rewriter.replaceOpWithNewOp<memref::LoadOp>(op, op.getMemRef(),
- *resultOperands,
- /*nontemporal=*/false,
- op.getMaybeAlign());
+ rewriter.replaceOpWithNewOp<memref::LoadOp>(
+ op, op.getMemRef(), *resultOperands,
+ /*nontemporal=*/false, op.getMaybeAlign());
return success();
}
};
diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index c1e0a08c6..403213b3c 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -1810,8 +1810,8 @@ void SimplifyAffineOp<AffineLoadOp>::replaceAffineOp(
PatternRewriter &rewriter, AffineLoadOp load, AffineMap map,
ArrayRef<Value> mapOperands) const {
IntegerAttr align = load.getAlignmentAttr();
- auto newOp = rewriter.replaceOpWithNewOp<AffineLoadOp>(
- load, load.getMemRef(), map, mapOperands);
+ auto newOp = rewriter.replaceOpWithNewOp<AffineLoadOp>(load, load.getMemRef(),
+ map, mapOperands);
if (align)
newOp.setAlignmentAttr(align);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/214532
More information about the Mlir-commits
mailing list