[Mlir-commits] [mlir] [mlir][bufferization] Expose buffer alignment as a pass option in one-shot-bufferize (PR #112505)

Simon Camphausen llvmlistbot at llvm.org
Wed Oct 16 02:06:20 PDT 2024


https://github.com/simon-camp created https://github.com/llvm/llvm-project/pull/112505

None

>From b011bfbc445e54730276c7352b42cd9c8dfbc3d1 Mon Sep 17 00:00:00 2001
From: Simon Camphausen <simon.camphausen at iml.fraunhofer.de>
Date: Wed, 16 Oct 2024 08:18:41 +0000
Subject: [PATCH] Expose buffer alignment as a pass option in one-shot
 bufferization

---
 mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td | 2 ++
 mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp      | 1 +
 2 files changed, 3 insertions(+)

diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td b/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td
index a683a905cd2d6b..cc5463ea968fc3 100644
--- a/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td
@@ -536,6 +536,8 @@ def OneShotBufferize : Pass<"one-shot-bufferize", "ModuleOp"> {
     Option<"unknownTypeConversion", "unknown-type-conversion", "std::string",
            /*default=*/"\"fully-dynamic-layout-map\"",
            "Controls layout maps for non-inferrable memref types.">,
+    Option<"bufferAlignment", "buffer-alignment", "uint64_t", /*default=*/"64",
+           "Sets the alignment of newly allocated buffers.">,
   ];
   let constructor = "mlir::bufferization::createOneShotBufferizePass()";
 
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
index 875d8c40e92cc1..1d009b03754c52 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
@@ -224,6 +224,7 @@ struct OneShotBufferizePass
         };
       }
       opt.printConflicts = printConflicts;
+      opt.bufferAlignment = bufferAlignment;
       opt.testAnalysisOnly = testAnalysisOnly;
       opt.bufferizeFunctionBoundaries = bufferizeFunctionBoundaries;
       opt.checkParallelRegions = checkParallelRegions;



More information about the Mlir-commits mailing list