[flang-commits] [PATCH] D148307: [flang][hlfir] Fix hlfir.set_length codegen

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Apr 14 00:50:39 PDT 2023


jeanPerier created this revision.
jeanPerier added a reviewer: vzakhari.
jeanPerier added a project: Flang.
Herald added subscribers: sunshaoce, mehdi_amini, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.

The bufferization pass was propagating the raw alloca storage
(which may not allow to later retrieve the length) instead of
the hlfir variable value (which is guaranteed to hold the
character length).

Fix this and makes packageBufferizedExpr "storage" argument and
getBufferizedExprStorage return an hlfir::Entity to avoid similar
error in the future (the caller of packageBufferizedExpr will have
to think a bit when adding the explicit hlfir::Entity{} cast).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148307

Files:
  flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
  flang/test/HLFIR/set_length-codegen.fir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148307.513463.patch
Type: text/x-patch
Size: 9015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230414/410da62e/attachment-0001.bin>


More information about the flang-commits mailing list