I want to build a op like:
%1 = memref.alloca() : memref<512xi32>
I have used
builder.create<memref::AllocaOp>(loc,builder.getI32Type().dyn_cast<MemRefType>(),
builder.getI32IntegerAttr(512));
but it show:(I have register memref in standalone-opt)
LLVM ERROR: Building op `memref.alloca` but it isn't registered in this MLIRContext: the dialect may not be loaded or this operation isn't registered by the dialect.
How can I converse IntegerType to MemRefType safely?