[PATCH] D73702: [WIP][mlir] enable conversion materialization for 1-1 type conversions

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 06:22:12 PST 2020


ftynse created this revision.
Herald added subscribers: llvm-commits, liufengdb, herhut, lucyrfox, mgester, arpith-jacob, csigg, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini, jholewinski.
Herald added a reviewer: nicolasvasilache.
Herald added a project: LLVM.
ftynse edited the summary of this revision.
ftynse edited reviewers, added: rriddle; removed: nicolasvasilache.
Herald added a reviewer: nicolasvasilache.

Change the conversion materialization hook in TypeConverter to support the materialization of 1-1 conversions. Instead of having the hook as a virtual function, keep it as a callback, (1) it would compose better with different type conversion extensions and (2)  this makes the hook optional. Change the hook signature to return Value instead of operation, allowing it to return the original value unmodified when no materialization is necessary for 1-1 conversion.

This diff also includes the changes to the LLVM and GPU dialect conversion to illustrate how this new support makes them simpler.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73702

Files:
  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-memref-ops.mlir
  mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
  mlir/test/lib/TestDialect/TestPatterns.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73702.241430.patch
Type: text/x-patch
Size: 13209 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200130/464a1ce9/attachment.bin>


More information about the llvm-commits mailing list