[flang-commits] [PATCH] D136955: [flang][NFC] move constant lowering into its own unit

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Oct 28 07:57:34 PDT 2022


jeanPerier created this revision.
jeanPerier added reviewers: clementval, PeteSteinfeld.
jeanPerier added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
jeanPerier requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136955

Files:
  flang/include/flang/Lower/ConvertConstant.h
  flang/include/flang/Lower/ConvertExpr.h
  flang/lib/Lower/CMakeLists.txt
  flang/lib/Lower/ConvertConstant.cpp
  flang/lib/Lower/ConvertExpr.cpp
  flang/lib/Lower/ConvertVariable.cpp
  flang/test/Lower/array-substring.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136955.471553.patch
Type: text/x-patch
Size: 54164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221028/fad7ffef/attachment-0001.bin>


More information about the flang-commits mailing list