[all-commits] [llvm/llvm-project] 2dc17f: [flang] fix isSimplyContiguous and isOptional hlfi...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Feb 3 02:47:52 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2dc17fd173b4b2266bc76782196c82b7a6046a2a
      https://github.com/llvm/llvm-project/commit/2dc17fd173b4b2266bc76782196c82b7a6046a2a
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2025-02-03 (Mon, 03 Feb 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/HLFIRTools.h
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    M flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
    M flang/test/HLFIR/assign-codegen.fir
    M flang/test/HLFIR/maxval-lowering.fir

  Log Message:
  -----------
  [flang] fix isSimplyContiguous and isOptional hlfir::Entity methods (#125215)

Fix isSimplyContiguous:

- It ignored scalars, causing scalar fir.box to not be opened when
possible in `translateToExtendedValue`

Fix isOptional:

It is not reliable when the memory SSA value cannot be linked to a
declare. This is exposed by the `isSimplyContiguous` fix,
This is wrong because declare operation should not always assumed to be
visible (e.g., value may travel through a select, or the optional be
generated by the compiler like genOptionalBox in
lib/Lower/ConvertCall.cpp).

- Turn `isOptional` into a safer `mayBeOptional`
- Update translateToExtendedValue to open scalar fir.box for such values
in a fir.if.
- It turned out some `translateToExtendedValue` usage relied on fir.box
of optional scalars to be left untouched (mainly because they want to
forward those fir.box to the runtime), add an option to allow that.



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