[all-commits] [llvm/llvm-project] 89227b: [flang][hlfir] relax the strictness of intrinsic v...

Tom Eccles via All-commits all-commits at lists.llvm.org
Wed Jun 7 07:36:50 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89227b670dcf60f1a7e75f57de8f88bad430d5c8
      https://github.com/llvm/llvm-project/commit/89227b670dcf60f1a7e75f57de8f88bad430d5c8
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2023-06-07 (Wed, 07 Jun 2023)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
    M flang/test/Lower/HLFIR/matmul.f90
    M flang/test/Lower/HLFIR/transpose.f90

  Log Message:
  -----------
  [flang][hlfir] relax the strictness of intrinsic verifiers

The verifiers for hlfir.matmul and hlfir.transpose try to ensure that
the shape of the result value makes sense given the shapes of the input
argument(s).

It there are some cases in the gfortran tests where lowering knows a bit
more about shape information than (HL)FIR. I think the cases here will be
solved when hlfir.shape_meet is implemented.

But in the meantime, and to improve robustness, I've relaxed the
verifier to allow the return type to have more precise shape information
than can be deduced from the argument type(s).

Differential Revision: https://reviews.llvm.org/D152254


  Commit: 6bcfab3161ea3a90b26dce3f85ba052933060b73
      https://github.com/llvm/llvm-project/commit/6bcfab3161ea3a90b26dce3f85ba052933060b73
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2023-06-07 (Wed, 07 Jun 2023)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
    M flang/test/HLFIR/matmul-lowering.fir

  Log Message:
  -----------
  [flang][hlfir] allow recursive intrinsic lowering

We need to allow recursive application of intrinsic lowering patterns,
otherwise we cannot lower nested calls of the same intrinsic e.g.
matmul(matmul(a, b), c).

matmul(matmul(a, b), matmul(c, d)) requires hlfir.associate of hlfir
expr with more than one use (TODO).

Differential Revision: https://reviews.llvm.org/D152284


Compare: https://github.com/llvm/llvm-project/compare/6efb2afc9fdf...6bcfab3161ea


More information about the All-commits mailing list