[Mlir-commits] [mlir] [mlir][acc] Extend PointerLikeType to provide alloc, dealloc, copy (PR #162328)
Valentin Clement バレンタイン クレメン
llvmlistbot at llvm.org
Wed Oct 8 09:59:02 PDT 2025
================
@@ -70,6 +72,116 @@ struct MemRefPointerLikeModel
assert(memrefTy.getRank() > 0 && "rank expected to be positive");
return mlir::acc::VariableTypeCategory::array;
}
+
+ mlir::Value genAllocate(Type pointer, OpBuilder &builder, Location loc,
+ StringRef varName, Type varType,
+ Value originalVar) const {
+ auto memrefTy = cast<MemRefType>(pointer);
+
+ // Check if this is a static memref (all dimensions are known) - if yes
+ // then we can generate an alloca operation.
+ if (memrefTy.hasStaticShape()) {
+ return memref::AllocaOp::create(builder, loc, memrefTy).getResult();
+ }
----------------
clementval wrote:
no brace
https://github.com/llvm/llvm-project/pull/162328
More information about the Mlir-commits
mailing list