[all-commits] [llvm/llvm-project] 32e7e1: [flang] Add hlfir.declare operation

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Nov 14 01:28:34 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 32e7e17d860b17731bc9347ab0488ea072356f50
      https://github.com/llvm/llvm-project/commit/32e7e17d860b17731bc9347ab0488ea072356f50
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-11-14 (Mon, 14 Nov 2022)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/include/flang/Optimizer/Dialect/FIRType.h
    M flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
    M flang/include/flang/Optimizer/HLFIR/CMakeLists.txt
    M flang/include/flang/Optimizer/HLFIR/HLFIRDialect.h
    M flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
    A flang/include/flang/Optimizer/HLFIR/HLFIROps.h
    A flang/include/flang/Optimizer/HLFIR/HLFIROps.td
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
    M flang/lib/Optimizer/HLFIR/IR/CMakeLists.txt
    M flang/lib/Optimizer/HLFIR/IR/HLFIRDialect.cpp
    A flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
    A flang/test/HLFIR/declare.fir
    A flang/test/HLFIR/invalid.fir

  Log Message:
  -----------
  [flang] Add hlfir.declare operation

This operation will be used to declare named variables in HLFIR.
See the added description in HLFIROpBase.td for more info about it.

The motivation behind this operation is described in https://reviews.llvm.org/D137634.

The FortranVariableInterface verifier is changed a bit. It used to
operate using the result type to verify the provided shape and length
parameters. This is a bit incorrect because what matters to verify the
information is the input address (This worked OK with fir.declare where
the input memref type is the same as the output result). Also, not all
operation defining variables will have an input memref with the same
meaning (hlfir.designate and hlfir.associate for instance).
Hence, this verifier is now optional and must be provided a memref to
operate.

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




More information about the All-commits mailing list