[all-commits] [llvm/llvm-project] eb1eb7: [flang] Do not resolve TRIM/REPEAT length to its a...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Oct 3 02:43:43 PDT 2022


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

  Changed paths:
    M flang/lib/Evaluate/intrinsics.cpp
    M flang/test/Evaluate/rewrite01.f90

  Log Message:
  -----------
  [flang] Do not resolve TRIM/REPEAT length to its argument length

For TRIM and REPEAT calls, semantics was creating ProcedureDesignators
using the length parameter of the arguments. This caused bugs when
folding LEN(TRIM(char_explicit_constant_length)). The same did not
appeared in folding for REPEAT because it is rewritten at a higher
level to LEN(c)*N.

This is not only a folding issue since any place (like lowering) may
try to use the bad length parameter from the created ProcedureDesignator.

Update intrinsic resolution to not copy the length parameter for TRIM
and REPEAT.

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




More information about the All-commits mailing list