[all-commits] [llvm/llvm-project] ac0f4c: [flang] Fix AllocaOp/AllocMemOp type conversion

PeixinQiao via All-commits all-commits at lists.llvm.org
Fri May 6 07:11:42 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac0f4c8f362e819316ca152315e930f4e6515e9d
      https://github.com/llvm/llvm-project/commit/ac0f4c8f362e819316ca152315e930f4e6515e9d
  Author: PeixinQiao <qiaopeixin at huawei.com>
  Date:   2022-05-06 (Fri, 06 May 2022)

  Changed paths:
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/test/Fir/alloc.fir
    M flang/test/Fir/convert-to-llvm.fir

  Log Message:
  -----------
  [flang] Fix AllocaOp/AllocMemOp type conversion

For arrays without a constant interior or arrays of character with
dynamic length arrays, the data types are converted to a pointer to the
element type, so the scale size of the constant extents needs to be
counted. The previous AllocaOp conversion does not consider the arrays
of character with dynamic length arrays, and the previous AllocMemOp
conversion does not consider arrays without a constant interior. This
fixes them and refactors the code so that it can be shared. Also add
the test cases.

Reviewed By: Jean Perier

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




More information about the All-commits mailing list