$ mlir-opt 02_types_and_dialects.mlir --finalize-memref-to-llvm --convert-arith-to-llvm --convert-func-to-llvm --reconcile-unrealized-casts | sed -n '/@memref_world/,/^ }/p'
what it printed on the machine that wrote this lab
llvm.func @memref_world(%arg0: !llvm.ptr, %arg1: !llvm.ptr, %arg2: i64, %arg3: i64, %arg4: i64, %arg5: f32) {
%0 = llvm.mlir.poison : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
...
%8 = llvm.getelementptr inbounds|nuw %7[%6] : (!llvm.ptr, i64) -> !llvm.ptr, f32
llvm.store %arg5, %8 : f32, !llvm.ptr
ONE memref<4xf32> argument became FIVE machine arguments:
(allocated ptr, aligned ptr, offset, size[0], stride[0])
A rank-N memref is 3 + 2N words. Remember this when you call MLIR code
from C (lab 02_lowering/04) or read a Triton launcher that packs args
(a vendor MLIR backend: the generated Triton launcher).