[all-commits] [llvm/llvm-project] af91b1: [flang][NFC] move constant lowering into its own unit

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Oct 31 07:38:03 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: af91b19338dde956ce7ebd6890d1a8e4295b091b
      https://github.com/llvm/llvm-project/commit/af91b19338dde956ce7ebd6890d1a8e4295b091b
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    A flang/include/flang/Lower/ConvertConstant.h
    M flang/include/flang/Lower/ConvertExpr.h
    M flang/lib/Lower/CMakeLists.txt
    A flang/lib/Lower/ConvertConstant.cpp
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/test/Lower/array-substring.f90

  Log Message:
  -----------
  [flang][NFC] move constant lowering into its own unit

This patch moves intrinsic evaluate::Constant<T> lowering into its own
unit outside of ScalarExpr and genarr lowering so that it can
be used by the new lowering without any changes.

DerivedType lowering cannot be shared at that stage because it is too
correlated with the current lowering (requires structure constructor
and designator lowering).

The code had to be refactored quite a bit so that it could be carved
out, but the only "functional" change is that the length of character
arrays lowered by genarr is now `index` instead of `i64` (see test change).
One non-functional benefit of the change is that `toEvExpr` is not
needed anymore and some compile time copies of big constant arrays
that it was causing are removed (see old calls in previous genarr code),
although I am not sure any compile time speed-ups are visible here.

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




More information about the All-commits mailing list