[all-commits] [llvm/llvm-project] 44c0bd: [flang][HLFIR] Use GreedyPatternRewriter in LowerH...

Tom Eccles via All-commits all-commits at lists.llvm.org
Fri Mar 1 02:16:40 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 44c0bdb402271522a17704b4a18c8bf5efb55c4f
      https://github.com/llvm/llvm-project/commit/44c0bdb402271522a17704b4a18c8bf5efb55c4f
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
    M flang/test/HLFIR/all-lowering.fir
    M flang/test/HLFIR/any-lowering.fir
    M flang/test/HLFIR/count-lowering-default-int-kinds.fir
    M flang/test/HLFIR/count-lowering.fir
    M flang/test/HLFIR/dot_product-lowering.fir
    M flang/test/HLFIR/extents-of-shape-of.f90
    M flang/test/HLFIR/matmul-lowering.fir
    M flang/test/HLFIR/maxloc-lowering.fir
    M flang/test/HLFIR/maxval-lowering.fir
    M flang/test/HLFIR/minloc-lowering.fir
    M flang/test/HLFIR/minval-lowering.fir
    M flang/test/HLFIR/mul_transpose.f90
    M flang/test/HLFIR/product-lowering.fir
    M flang/test/HLFIR/sum-lowering.fir
    M flang/test/HLFIR/transpose-lowering.fir
    M flang/test/Lower/convert.f90

  Log Message:
  -----------
  [flang][HLFIR] Use GreedyPatternRewriter in LowerHLFIRIntrinsics (#83438)

In #83253 @matthias-springer pointed out that LowerHLFIRIntrinsics.cpp
should not be using rewrite patterns with the dialect conversion driver.

The intention of this pass is to lower HLFIR intrinsic operations into
FIR so it conceptually fits dialect conversion. However, dialect
conversion is much stricter about changing types when replacing
operations. This pass sometimes looses track of array bounds, resulting
in replacements with operations with different but compatible types
(expressions of the same rank and element types but with or without
compile time known array bounds). This is difficult to accommodate with
the dialect conversion driver and so I have changed to use the greedy
pattern rewriter.

There is a lot of test churn because the greedy pattern rewriter also
performs canonicalization.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list