[all-commits] [llvm/llvm-project] 9b9a84: [flang] do not generate padding/truncation code wh...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Dec 6 00:34:42 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b9a8475d3ac9efad59554a25c940ef37b2056e3
      https://github.com/llvm/llvm-project/commit/9b9a8475d3ac9efad59554a25c940ef37b2056e3
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M flang/lib/Optimizer/Builder/Character.cpp
    M flang/test/Lower/OpenMP/omp-parallel-lastprivate-clause-scalar.f90
    M flang/test/Lower/array-expression.f90

  Log Message:
  -----------
  [flang] do not generate padding/truncation code when character length are equals

When generating character assignment operations, the generic code
generates some code to handle truncation and padding when the length
differ at runtime. A bypass already exists when the length are compile
time constant and match, but it was not used for the trivial case where
the RHS and LHS length is the same SSA value. In such case, even though,
the length is not know at compile time, it is known to be the same.

This will simplify the code creating character temporaries from a
variable in HLFIR that will use this assignment code.

Note that this probably has little impact on performance (llvm may be clever enough
to later catch that for us). But it makes the generated IR a lot more readable at
little cost.

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




More information about the All-commits mailing list