Page MenuHomePhabricator

[mlir] factor out common parts of the converstion to the LLVM dialect
ClosedPublic

Authored by ftynse on Jul 7 2021, 1:01 AM.

Details

Summary

"Standard-to-LLVM" conversion is one of the oldest passes in existence. It has
become quite large due to the size of the Standard dialect itself, which is
being split into multiple smaller dialects. Furthermore, several conversion
features are useful for any dialect that is being converted to the LLVM
dialect, which, without this refactoring, creates a dependency from those
conversions to the "standard-to-llvm" one.

Put several of the reusable utilities from this conversion to a separate
library, namely:

  • type converter from builtin to LLVM dialect types;
  • utility for building and accessing values of LLVM structure type;
  • utility for building and accessing values that represent memref in the LLVM dialect;
  • lowering options applicable everywhere.

Additionally, remove the type wrapping/unwrapping notion from the type
converter that is no longer relevant since LLVM types has been reimplemented as
first-class MLIR types.

Diff Detail

Event Timeline

ftynse created this revision.Jul 7 2021, 1:01 AM
ftynse requested review of this revision.Jul 7 2021, 1:01 AM
Herald added a project: Restricted Project. · View Herald Transcript
pifon2a accepted this revision.Jul 7 2021, 1:16 AM
pifon2a added inline comments.
mlir/include/mlir/Conversion/LLVMCommon/LoweringOptions.h
34

is explicit needed for the constructor with 2 args?

This revision is now accepted and ready to land.Jul 7 2021, 1:16 AM
ftynse marked an inline comment as done.Jul 7 2021, 1:50 AM
This revision was landed with ongoing or failed builds.Jul 7 2021, 1:51 AM
This revision was automatically updated to reflect the committed changes.