std.alloc only supports memrefs with identity layout, which means we can simplify the lowering to LLVM and compute strides only from (static and dynamic) sizes.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Nice!
| mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h | ||
|---|---|---|
| 525 | Nit: could we also document that it emits instructions necessary to compute the strides and the total size? | |
| mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
| 1115 | Cool trick! | |
| 1139–1140 | This seems like it would properly support cases with vectors due to padding an alignment, e.g., memref<4 x vector<3 x f32>>, right? | |
| mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
|---|---|---|
| 1115 | It's a shame that clang-tidy doesn't format the goes-to operator correctly. | |
| 1139–1140 | Yes, see for example the %t4 example here: https://llvm.org/docs/LangRef.html#getelementptr-instruction | |
Nit: could we also document that it emits instructions necessary to compute the strides and the total size?