[all-commits] [llvm/llvm-project] e39838: [flang][fir] add codegen for fir.load of assumed-r...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu May 30 00:30:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e398383f9a05ec6f3766e5ab49dd862a72325ba6
      https://github.com/llvm/llvm-project/commit/e398383f9a05ec6f3766e5ab49dd862a72325ba6
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-05-30 (Thu, 30 May 2024)

  Changed paths:
    M flang/include/flang/Optimizer/CodeGen/FIROpPatterns.h
    M flang/include/flang/Optimizer/CodeGen/TypeConverter.h
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/lib/Optimizer/CodeGen/FIROpPatterns.cpp
    M flang/lib/Optimizer/CodeGen/TypeConverter.cpp
    M flang/test/Fir/convert-to-llvm.fir
    M flang/test/Fir/tbaa.fir

  Log Message:
  -----------
  [flang][fir] add codegen for fir.load of assumed-rank fir.box (#93569)

- Update LLVM type conversion of assumed-rank fir.box/class to generate
the type of the maximum ranked descriptor. That way, alloca for assumed
rank descriptor copies are always big enough. This is needed in the
fir.load case that generates a new storage for the value
- Add a "computeBoxSize" helper to compute the dynamic size of a
descriptor.
- Use that size to generate an llvm.memcpy intrinsic to copy the input
descriptor into the new storage.

Looking at https://reviews.llvm.org/D108221?id=404635, it seems valid to
add the TBAA node on the memcpy, which I did.

In a further patch, I think we should likely always use a memcpy since
LLVM seems to have a better time optimizing it than fir.load/fir.store
patterns.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list