[all-commits] [llvm/llvm-project] 422b84: [MLIR][LLVM] DI Expression Rewrite & Legalization ...

Billy Zhu via All-commits all-commits at lists.llvm.org
Wed Jan 10 16:10:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 422b84a77167c43259e18cc3eff88b4b2530defc
      https://github.com/llvm/llvm-project/commit/422b84a77167c43259e18cc3eff88b4b2530defc
  Author: Billy Zhu <billyzhu at modular.com>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    A mlir/include/mlir/Dialect/LLVMIR/Transforms/DIExpressionLegalization.h
    A mlir/include/mlir/Dialect/LLVMIR/Transforms/DIExpressionRewriter.h
    M mlir/lib/Dialect/LLVMIR/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/LLVMIR/Transforms/DIExpressionLegalization.cpp
    A mlir/lib/Dialect/LLVMIR/Transforms/DIExpressionRewriter.cpp
    M mlir/lib/Dialect/LLVMIR/Transforms/LegalizeForExport.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    A mlir/test/Dialect/LLVMIR/di-expression-legalization.mlir

  Log Message:
  -----------
  [MLIR][LLVM] DI Expression Rewrite & Legalization (#77541)

Add a rewriter for DIExpressions & use it to run legalization patterns
before exporting to llvm (because LLVM dialect allows DI Expressions
that may not be valid in LLVM IR).

The rewriter driver works similarly to the existing mlir rewriter
drivers, except it operates on lists of DIExpressionElemAttr (i.e.
DIExpressionAttr). Each rewrite pattern transforms a range of
DIExpressionElemAttr into a new list of DIExpressionElemAttr.

In addition, this PR sets up a place to add legalization patterns that
are broadly applicable internally to the LLVM dialect, and they will
always be applied prior to export. This PR adds one pattern for merging
fragment operators.

---------

Co-authored-by: Tobias Gysi <tobias.gysi at nextsilicon.com>




More information about the All-commits mailing list