[PATCH] D72802: [mlir] Introduce bare ptr calling convention for MemRefs in LLVM dialect
Diego Caballero via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 28 09:07:49 PST 2020
dcaballe updated this revision to Diff 240901.
dcaballe marked 2 inline comments as done.
dcaballe added a comment.
Hopefully this approach looks better now! Let's iterate on it.
Changes:
- Add customization callbacks to LLVMTypeConverter.
This implementation is a stepping stone towards a pattern-based type conversion approach that allows customization of different points of the type conversion and different types for each customization point.
Re current implementation:
- It only allows customization of different points but not customization of different types for each customziation point for now but it should be easy to extend once the latter is needed.
- LLVMTypeConverterCustomization holds the callbacks for the customizations points available (only function argument types for now) and it's initialized by default to the pre-existing calling convention.
- 'makeStandardToLLVMBarePtrTypeConverter' is private on purpose to avoid a combinatorial explosion similar to that of populate* functions. Customization methods are made public to allow external clients to create their ad-hoc customizations.
- Keep 'populateStdToLLVMBarePtrFuncOpConversionPattern'
This is to reduce the number of public populate* functions. Follow-up work is needed to avoid a potential combinatorial explosion. Probably making rewrite patterns public would help here.
- Add test with mlir_cpu_runner
mlir-cpu-runner entry-point invocation is currently limited to a couple of function signatures. For that reason we use a () -> () entry-point function that allocates memrefs, initializes them, passes them to another function and print their output values. Therefore, no changes are needed at JitRunner level for now since the entry-point function won't have memref arguments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72802/new/
https://reviews.llvm.org/D72802
Files:
mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
mlir/include/mlir/Transforms/DialectConversion.h
mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
mlir/lib/Transforms/DialectConversion.cpp
mlir/test/Conversion/StandardToLLVM/convert-dynamic-memref-ops.mlir
mlir/test/Conversion/StandardToLLVM/convert-memref-ops.mlir
mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir
mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72802.240901.patch
Type: text/x-patch
Size: 63254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200128/07c12641/attachment-0001.bin>
More information about the llvm-commits
mailing list