[all-commits] [llvm/llvm-project] ec2c0e: [flang][hlfir] Generate explicit HLFIR type cast f...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Thu May 4 09:19:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec2c0e0f55637209d1901c73f162dd8625034a56
      https://github.com/llvm/llvm-project/commit/ec2c0e0f55637209d1901c73f162dd8625034a56
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
    M flang/test/Lower/HLFIR/assignment-intrinsics.f90
    M flang/test/Lower/HLFIR/expr-as-inquired.f90
    A flang/test/Lower/HLFIR/implicit-type-conversion.f90

  Log Message:
  -----------
  [flang][hlfir] Generate explicit HLFIR type cast for implicit logical<->integer conversion.

hlfir.assign, in general, ends up calling the Assign runtime that asserts
that the types of LHS and RHS match. In case of implicit logical<->integer
conversions (allowed as an extension) the operands of hlfir.assign
have non-matching types. This change makes sure that the lowering
produces explicit type cast (either as a scalar fir.convert or
as a hlfir.elemental producing array expression).

Reviewed By: jeanPerier

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




More information about the All-commits mailing list